完善 MCS 桌面代理与开炼机动作同步,修复原料相关菜单权限,桌面端新增上辅机 MES 菜单。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-27 15:56:05 +08:00
parent 7a9c19e4f3
commit 442a4c8ae2
113 changed files with 10169 additions and 91 deletions

View File

@@ -1,13 +1,18 @@
import { BasicColumn, FormSchema } from '/@/components/Table';
export const baseColumns: BasicColumn[] = [
{ title: '日期', align: 'center', dataIndex: 'statDate', width: 140 },
{ title: '原材料名称', align: 'center', dataIndex: 'rawMaterialName', width: 260, ellipsis: true },
{ title: '需求重量(KG)', align: 'center', dataIndex: 'demandWeight', width: 180 },
];
export const machineColumns: BasicColumn[] = [{ title: '机台', align: 'center', dataIndex: 'machineName', width: 180 }, ...baseColumns];
export const machineColumns: BasicColumn[] = [
baseColumns[0],
{ title: '机台', align: 'center', dataIndex: 'machineName', width: 180 },
...baseColumns.slice(1),
];
export const searchFormSchema: FormSchema[] = [
export const baseSearchFormSchema: FormSchema[] = [
{
label: '日期',
field: 'statDate',
@@ -18,6 +23,12 @@ export const searchFormSchema: FormSchema[] = [
{ label: '原材料名称', field: 'rawMaterialName', component: 'JInput', colProps: { span: 6 } },
];
export const machineSearchFormSchema: FormSchema[] = [
baseSearchFormSchema[0],
{ label: '机台', field: 'machineName', component: 'JInput', colProps: { span: 6 } },
...baseSearchFormSchema.slice(1),
];
export const superQuerySchema = {
machineName: { title: '机台', order: 0, view: 'text' },
statDate: { title: '日期', order: 1, view: 'date' },

View File

@@ -25,7 +25,8 @@
import {
baseColumns,
machineColumns,
searchFormSchema,
baseSearchFormSchema,
machineSearchFormSchema,
superQuerySchema,
} from './MesXslAutoSmallMaterialDemandPlan.data';
import { list, getExportUrl } from './MesXslAutoSmallMaterialDemandPlan.api';
@@ -40,7 +41,7 @@
columns: baseColumns,
canResize: true,
formConfig: {
schemas: searchFormSchema,
schemas: baseSearchFormSchema,
autoSubmitOnEnter: true,
showAdvancedButton: true,
},
@@ -57,20 +58,33 @@
},
});
const [registerTable, { reload, setColumns }] = tableContext;
const [registerTable, { reload, setColumns, setProps }] = tableContext;
const superQueryConfig = reactive(superQuerySchema);
onMounted(() => {
applyColumns();
applySearchSchemas();
});
function applyColumns() {
setColumns(groupByMachine.value ? machineColumns : baseColumns);
}
function applySearchSchemas() {
setProps({
formConfig: {
schemas: groupByMachine.value ? machineSearchFormSchema : baseSearchFormSchema,
},
});
}
function onGroupByMachineChange() {
queryParam.groupByMachine = groupByMachine.value ? 1 : 0;
if (!groupByMachine.value) {
delete queryParam.machineName;
}
applyColumns();
applySearchSchemas();
reload();
}

View File

@@ -1,13 +1,18 @@
import { BasicColumn, FormSchema } from '/@/components/Table';
export const baseColumns: BasicColumn[] = [
{ title: '日期', align: 'center', dataIndex: 'statDate', width: 140 },
{ title: '原材料名称', align: 'center', dataIndex: 'rawMaterialName', width: 260, ellipsis: true },
{ title: '需求重量(KG)', align: 'center', dataIndex: 'demandWeight', width: 180 },
];
export const machineColumns: BasicColumn[] = [{ title: '机台', align: 'center', dataIndex: 'machineName', width: 180 }, ...baseColumns];
export const machineColumns: BasicColumn[] = [
baseColumns[0],
{ title: '机台', align: 'center', dataIndex: 'machineName', width: 180 },
...baseColumns.slice(1),
];
export const searchFormSchema: FormSchema[] = [
export const baseSearchFormSchema: FormSchema[] = [
{
label: '日期',
field: 'statDate',
@@ -18,6 +23,12 @@ export const searchFormSchema: FormSchema[] = [
{ label: '原材料名称', field: 'rawMaterialName', component: 'JInput', colProps: { span: 6 } },
];
export const machineSearchFormSchema: FormSchema[] = [
baseSearchFormSchema[0],
{ label: '机台', field: 'machineName', component: 'JInput', colProps: { span: 6 } },
...baseSearchFormSchema.slice(1),
];
export const superQuerySchema = {
machineName: { title: '机台', order: 0, view: 'text' },
statDate: { title: '日期', order: 1, view: 'date' },

View File

@@ -25,7 +25,8 @@
import {
baseColumns,
machineColumns,
searchFormSchema,
baseSearchFormSchema,
machineSearchFormSchema,
superQuerySchema,
} from './MesXslManualSmallMaterialDemandPlan.data';
import { list, getExportUrl } from './MesXslManualSmallMaterialDemandPlan.api';
@@ -40,7 +41,7 @@
columns: baseColumns,
canResize: true,
formConfig: {
schemas: searchFormSchema,
schemas: baseSearchFormSchema,
autoSubmitOnEnter: true,
showAdvancedButton: true,
},
@@ -57,20 +58,33 @@
},
});
const [registerTable, { reload, setColumns }] = tableContext;
const [registerTable, { reload, setColumns, setProps }] = tableContext;
const superQueryConfig = reactive(superQuerySchema);
onMounted(() => {
applyColumns();
applySearchSchemas();
});
function applyColumns() {
setColumns(groupByMachine.value ? machineColumns : baseColumns);
}
function applySearchSchemas() {
setProps({
formConfig: {
schemas: groupByMachine.value ? machineSearchFormSchema : baseSearchFormSchema,
},
});
}
function onGroupByMachineChange() {
queryParam.groupByMachine = groupByMachine.value ? 1 : 0;
if (!groupByMachine.value) {
delete queryParam.machineName;
}
applyColumns();
applySearchSchemas();
reload();
}

View File

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

View File

@@ -0,0 +1,33 @@
import { BasicColumn, FormSchema } from '/@/components/Table';
export const columns: BasicColumn[] = [
{ title: 'GUID', align: 'center', dataIndex: 'guid', width: 280 },
{ title: '动作地址', align: 'center', dataIndex: 'actAddr', width: 100 },
{ title: '动作名称', align: 'center', dataIndex: 'actName', width: 140 },
{ title: '动作名称(英)', align: 'center', dataIndex: 'actNameEn', width: 140 },
{ title: '动作备注', align: 'center', dataIndex: 'actMemo', width: 120 },
{ title: '关联地址', align: 'center', dataIndex: 'actRepaddr', width: 100 },
{ title: '写入时间', align: 'center', dataIndex: 'writeTime', width: 170 },
{ title: '读写标识', align: 'center', dataIndex: 'rwFlag', width: 90 },
{ title: '更新时间', align: 'center', dataIndex: 'updateTime', width: 170 },
];
export const searchFormSchema: FormSchema[] = [
{ label: '动作名称', field: 'actName', component: 'Input', colProps: { span: 6 } },
{ label: '动作地址', field: 'actAddr', component: 'InputNumber', colProps: { span: 6 } },
{ label: 'GUID', field: 'guid', component: 'Input', colProps: { span: 6 } },
];
export const formSchema: FormSchema[] = [
{ label: '', field: 'id', component: 'Input', show: false },
{ label: 'GUID', field: 'guid', component: 'Input', componentProps: { disabled: true }, colProps: { span: 24 } },
{ label: '动作地址', field: 'actAddr', component: 'InputNumber', componentProps: { disabled: true }, colProps: { span: 12 } },
{ label: '关联地址', field: 'actRepaddr', component: 'InputNumber', componentProps: { disabled: true }, colProps: { span: 12 } },
{ label: '动作名称', field: 'actName', component: 'Input', componentProps: { disabled: true }, colProps: { span: 12 } },
{ label: '动作名称(英)', field: 'actNameEn', component: 'Input', componentProps: { disabled: true }, colProps: { span: 12 } },
{ label: '动作备注', field: 'actMemo', component: 'Input', componentProps: { disabled: true }, colProps: { span: 24 } },
{ label: '写入时间', field: 'writeTime', component: 'Input', componentProps: { disabled: true }, colProps: { span: 12 } },
{ label: '读取时间', field: 'readTime', component: 'Input', componentProps: { disabled: true }, colProps: { span: 12 } },
{ label: '读写标识', field: 'rwFlag', component: 'InputNumber', componentProps: { disabled: true }, colProps: { span: 12 } },
{ label: '更新时间', field: 'updateTime', component: 'Input', componentProps: { disabled: true }, colProps: { span: 12 } },
];

View File

@@ -0,0 +1,81 @@
<template>
<div class="mes-xsl-mill-action-page">
<BasicTable @register="registerTable">
<template #tableTitle>
<a-button type="primary" v-auth="'xslmes:mcsSyncConfig:setting'" preIcon="ant-design:sync-outlined" @click="openCollect"> 采集操作 </a-button>
<a-button type="link" v-auth="'xslmes:mes_xsl_mill_action:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
</template>
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" />
</template>
</BasicTable>
<MesXslMillActionModal @register="registerModal" />
<CollectModal @register="registerCollectModal" @success="reload" />
</div>
</template>
<script lang="ts" name="xslmes-mesXslMillAction" setup>
import { BasicTable, TableAction } from '/@/components/Table';
import { useModal } from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage';
import MesXslMillActionModal from './components/MesXslMillActionModal.vue';
import CollectModal from '/@/views/xslmesMcs/mcsSyncConfig/components/CollectModal.vue';
import { columns, searchFormSchema } from './MesXslMillAction.data';
import { list, getExportUrl } from './MesXslMillAction.api';
const [registerModal, { openModal }] = useModal();
const [registerCollectModal, { openModal: openCollectModal }] = useModal();
const { tableContext, onExportXls } = useListPage({
tableProps: {
title: '开炼机动作接收',
api: list,
columns,
canResize: true,
formConfig: { labelWidth: 100, schemas: searchFormSchema, autoSubmitOnEnter: true },
actionColumn: { width: 80, fixed: 'right' },
},
exportConfig: { name: '开炼机动作接收', url: getExportUrl },
});
const [registerTable, { reload }] = tableContext;
function openCollect() {
openCollectModal(true, { bizType: 'MILL_ACT' });
}
function handleDetail(record: Recordable) {
openModal(true, { record, isUpdate: true, showFooter: false });
}
function getTableAction(record) {
return [{ label: '详情', onClick: handleDetail.bind(null, record) }];
}
</script>
<style lang="less" scoped>
/* 空数据时 BasicTable canResize 不计算高度,用视口高度把表格区域铺满 */
.mes-xsl-mill-action-page {
min-height: calc(100vh - 120px);
:deep(.jeecg-basic-table-form-container) {
min-height: inherit;
}
:deep(.ant-table-wrapper),
:deep(.ant-spin-nested-loading),
:deep(.ant-spin-container),
:deep(.ant-table),
:deep(.ant-table-container) {
min-height: calc(100vh - 280px);
}
:deep(.ant-table-body) {
min-height: calc(100vh - 360px) !important;
}
:deep(.ant-table-tbody > tr.ant-table-placeholder > td) {
height: calc(100vh - 360px);
}
}
</style>

View File

@@ -0,0 +1,30 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose title="开炼机动作接收" :width="900">
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import { BasicModal, useModalInner } from '/@/components/Modal';
import { BasicForm, useForm } from '/@/components/Form/index';
import { formSchema } from '../MesXslMillAction.data';
defineEmits(['register']);
const [registerForm, { resetFields, setFieldsValue, setProps }] = useForm({
labelWidth: 120,
schemas: formSchema,
showActionButtonGroup: false,
baseColProps: { span: 12 },
disabled: true,
});
const [registerModal, { setModalProps }] = useModalInner(async (data) => {
await resetFields();
setModalProps({ confirmLoading: false, showOkBtn: false, showCancelBtn: true, cancelText: '关闭' });
if (data?.record) {
await setFieldsValue({ ...data.record });
}
setProps({ disabled: true });
});
</script>

View File

@@ -10,16 +10,23 @@ export const baseColumns: BasicColumn[] = [
];
export const machineColumns: BasicColumn[] = [
baseColumns[0],
{ title: '机台', align: 'center', dataIndex: 'machineName', width: 160 },
...baseColumns,
...baseColumns.slice(1),
];
export const searchFormSchema: FormSchema[] = [
export const baseSearchFormSchema: FormSchema[] = [
{ label: '计划日期', field: 'planDate', component: 'DatePicker', colProps: { span: 6 } },
{ label: 'ERP编号', field: 'erpCode', component: 'JInput', colProps: { span: 6 } },
{ label: '原材料名称', field: 'rawMaterialName', component: 'JInput', colProps: { span: 6 } },
];
export const machineSearchFormSchema: FormSchema[] = [
baseSearchFormSchema[0],
{ label: '机台', field: 'machineName', component: 'JInput', colProps: { span: 6 } },
...baseSearchFormSchema.slice(1),
];
export const superQuerySchema = {
planDate: { title: '计划日期', order: 0, view: 'date' },
machineName: { title: '机台', order: 1, view: 'text' },

View File

@@ -25,7 +25,8 @@
import {
baseColumns,
machineColumns,
searchFormSchema,
baseSearchFormSchema,
machineSearchFormSchema,
superQuerySchema,
} from './MesXslRawMaterialDemandPlan.data';
import { list, getExportUrl } from './MesXslRawMaterialDemandPlan.api';
@@ -40,7 +41,7 @@
columns: baseColumns,
canResize: true,
formConfig: {
schemas: searchFormSchema,
schemas: baseSearchFormSchema,
autoSubmitOnEnter: true,
showAdvancedButton: true,
},
@@ -57,20 +58,33 @@
},
});
const [registerTable, { reload, setColumns }] = tableContext;
const [registerTable, { reload, setColumns, setProps }] = tableContext;
const superQueryConfig = reactive(superQuerySchema);
onMounted(() => {
applyColumns();
applySearchSchemas();
});
function applyColumns() {
setColumns(groupByMachine.value ? machineColumns : baseColumns);
}
function applySearchSchemas() {
setProps({
formConfig: {
schemas: groupByMachine.value ? machineSearchFormSchema : baseSearchFormSchema,
},
});
}
function onGroupByMachineChange() {
queryParam.groupByMachine = groupByMachine.value ? 1 : 0;
if (!groupByMachine.value) {
delete queryParam.machineName;
}
applyColumns();
applySearchSchemas();
reload();
}