母胶计划、终胶计划

This commit is contained in:
2026-05-29 15:48:58 +08:00
parent c70f7b2b90
commit c8ce7a6fa3
33 changed files with 1520 additions and 6 deletions

View File

@@ -0,0 +1,7 @@
<template>
<MesXslFinalBatchPlanList />
</template>
<script lang="ts" setup>
import MesXslFinalBatchPlanList from '../../xslmes/mesXslFinalBatchPlan/MesXslFinalBatchPlanList.vue';
</script>

View File

@@ -0,0 +1,7 @@
<template>
<MesXslMasterBatchPlanList />
</template>
<script lang="ts" setup>
import MesXslMasterBatchPlanList from '../../xslmes/mesXslMasterBatchPlan/MesXslMasterBatchPlanList.vue';
</script>

View File

@@ -0,0 +1,25 @@
import { defHttp } from '/@/utils/http/axios';
enum Api {
list = '/xslmes/mesXslFinalBatchPlan/list',
save = '/xslmes/mesXslFinalBatchPlan/add',
edit = '/xslmes/mesXslFinalBatchPlan/edit',
deleteOne = '/xslmes/mesXslFinalBatchPlan/delete',
deleteBatch = '/xslmes/mesXslFinalBatchPlan/deleteBatch',
queryById = '/xslmes/mesXslFinalBatchPlan/queryById',
exportXls = '/xslmes/mesXslFinalBatchPlan/exportXls',
}
export const list = (params) => defHttp.get({ url: Api.list, params });
export const deleteOne = (params, handleSuccess) =>
defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => handleSuccess());
export const batchDelete = (params, handleSuccess) =>
defHttp.delete({ url: Api.deleteBatch, params }, { joinParamsToUrl: true }).then(() => handleSuccess());
export const saveOrUpdate = (params, isUpdate) => defHttp.post({ url: isUpdate ? Api.edit : Api.save, params });
export const queryById = (params) => defHttp.get({ url: Api.queryById, params });
export const getExportUrl = Api.exportXls;

View File

@@ -0,0 +1,68 @@
import { BasicColumn, FormSchema } from '/@/components/Table';
function statusText(v: unknown) {
if (v === 1) return '进行中';
if (v === 2) return '已完成';
return '未开始';
}
const statusOptions = [
{ label: '未开始', value: 0 },
{ label: '进行中', value: 1 },
{ label: '已完成', value: 2 },
];
export const columns: BasicColumn[] = [
{ title: '订单流水', align: 'center', dataIndex: 'orderSerialNo', width: 180 },
{ title: '订单编号', align: 'center', dataIndex: 'orderNo', width: 150 },
{ title: '生产段数', align: 'center', dataIndex: 'productionSegmentCount', width: 100 },
{ title: '订单日期', align: 'center', dataIndex: 'orderDate', width: 130 },
{ title: '物料编码', align: 'center', dataIndex: 'materialCode', width: 130 },
{ title: 'MES胶料信息', align: 'center', dataIndex: 'mesMaterialName', width: 150 },
{ title: '计划重量', align: 'center', dataIndex: 'planWeight', width: 110 },
{ title: '每车重量', align: 'center', dataIndex: 'perCarWeight', width: 110 },
{ title: '计划车数', align: 'center', dataIndex: 'plannedCarCount', width: 100 },
{ title: '已排产车数', align: 'center', dataIndex: 'scheduledCarCount', width: 110 },
{ title: '完成车数', align: 'center', dataIndex: 'finishedCarCount', width: 100 },
{ title: '状态', align: 'center', dataIndex: 'status', width: 100, customRender: ({ text }) => statusText(text) },
{ title: '创建人', align: 'center', dataIndex: 'createBy', width: 100 },
{ title: '创建时间', align: 'center', dataIndex: 'createTime', width: 170 },
{ title: '修改人', align: 'center', dataIndex: 'updateBy', width: 100 },
{ title: '修改时间', align: 'center', dataIndex: 'updateTime', width: 170 },
];
export const searchFormSchema: FormSchema[] = [
{ label: '订单流水', field: 'orderSerialNo', component: 'Input', colProps: { span: 6 } },
{ label: '订单编号', field: 'orderNo', component: 'Input', colProps: { span: 6 } },
{ label: '物料编码', field: 'materialCode', component: 'Input', colProps: { span: 6 } },
{ label: 'MES胶料信息', field: 'mesMaterialName', component: 'Input', colProps: { span: 6 } },
{
label: '状态',
field: 'status',
component: 'Select',
componentProps: { options: statusOptions },
colProps: { span: 6 },
},
];
export const formSchema: FormSchema[] = [
{ label: '', field: 'id', component: 'Input', show: false },
{ label: '', field: 'sourceOrderId', component: 'Input', show: false },
{ label: '订单流水', field: 'orderSerialNo', component: 'Input', componentProps: { disabled: true } },
{ label: '订单编号', field: 'orderNo', component: 'Input', componentProps: { disabled: true } },
{ label: '生产段数', field: 'productionSegmentCount', component: 'InputNumber', componentProps: { disabled: true } },
{
label: '订单日期',
field: 'orderDate',
component: 'DatePicker',
componentProps: { valueFormat: 'YYYY-MM-DD', style: { width: '100%' }, disabled: true },
},
{ label: '物料编码', field: 'materialCode', component: 'Input', componentProps: { disabled: true } },
{ label: 'MES胶料信息', field: 'mesMaterialName', component: 'Input', componentProps: { disabled: true } },
{ label: '计划重量', field: 'planWeight', component: 'InputNumber', componentProps: { disabled: true } },
{ label: '每车重量', field: 'perCarWeight', component: 'InputNumber', componentProps: { min: 0 } },
{ label: '计划车数', field: 'plannedCarCount', component: 'InputNumber', componentProps: { disabled: true } },
{ label: '已排产车数', field: 'scheduledCarCount', component: 'InputNumber', componentProps: { min: 0, precision: 0 } },
{ label: '完成车数', field: 'finishedCarCount', component: 'InputNumber', componentProps: { min: 0, precision: 0 } },
{ label: '状态', field: 'status', component: 'Select', componentProps: { options: statusOptions } },
];

View File

@@ -0,0 +1,80 @@
<template>
<div>
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<template #tableTitle>
<a-button
type="primary"
v-auth="'xslmes:mes_xsl_final_batch_plan:exportXls'"
preIcon="ant-design:export-outlined"
@click="onExportXls"
>
导出
</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete"><Icon icon="ant-design:delete-outlined" />删除</a-menu-item>
</a-menu>
</template>
<a-button>批量操作<Icon icon="mdi:chevron-down" /></a-button>
</a-dropdown>
</template>
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
</template>
</BasicTable>
<MesXslFinalBatchPlanModal @register="registerModal" @success="handleSuccess" />
</div>
</template>
<script lang="ts" setup>
import { BasicTable, TableAction } from '/@/components/Table';
import { useModal } from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage';
import MesXslFinalBatchPlanModal from './modules/MesXslFinalBatchPlanModal.vue';
import { columns, searchFormSchema } from './MesXslFinalBatchPlan.data';
import { batchDelete, deleteOne, getExportUrl, list } from './MesXslFinalBatchPlan.api';
const [registerModal, { openModal }] = useModal();
const { tableContext, onExportXls } = useListPage({
tableProps: {
title: '终胶计划',
api: list,
columns,
canResize: true,
formConfig: { labelWidth: 100, schemas: searchFormSchema, autoSubmitOnEnter: true, showAdvancedButton: true },
actionColumn: { width: 120, fixed: 'right' },
},
exportConfig: { name: '终胶计划', url: getExportUrl },
});
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
function handleEdit(record: Recordable) {
openModal(true, { record, isUpdate: true, showFooter: true });
}
function handleDetail(record: Recordable) {
openModal(true, { record, isUpdate: true, showFooter: false });
}
async function handleDelete(record) {
await deleteOne({ id: record.id }, reload);
}
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value.join(',') }, reload);
}
function handleSuccess() {
reload();
}
function getTableAction(record) {
return [{ label: '编辑', onClick: handleEdit.bind(null, record), auth: 'xslmes:mes_xsl_final_batch_plan:edit' }];
}
function getDropDownAction(record) {
return [
{ label: '详情', onClick: handleDetail.bind(null, record) },
{
label: '删除',
popConfirm: { title: '是否确认删除', confirm: handleDelete.bind(null, record) },
auth: 'xslmes:mes_xsl_final_batch_plan:delete',
},
];
}
</script>

View File

@@ -0,0 +1,51 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" width="920px" @ok="handleSubmit">
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import { computed, ref, unref } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { BasicForm, useForm } from '/@/components/Form/index';
import { formSchema } from '../MesXslFinalBatchPlan.data';
import { saveOrUpdate } from '../MesXslFinalBatchPlan.api';
const emit = defineEmits(['register', 'success']);
const isUpdate = ref(true);
const isDetail = ref(false);
const [registerForm, { resetFields, setFieldsValue, validate, setProps }] = useForm({
labelWidth: 110,
schemas: formSchema,
showActionButtonGroup: false,
baseColProps: { span: 12 },
});
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
await resetFields();
setModalProps({ confirmLoading: false, showCancelBtn: data?.showFooter, showOkBtn: data?.showFooter });
isUpdate.value = !!data?.isUpdate;
isDetail.value = !data?.showFooter;
if (unref(isUpdate)) {
await setFieldsValue({ ...data.record });
}
setProps({ disabled: !data?.showFooter });
});
const title = computed(() =>
!unref(isUpdate) ? '新增终胶计划' : unref(isDetail) ? '终胶计划详情' : '编辑终胶计划',
);
async function handleSubmit() {
try {
const values = await validate();
setModalProps({ confirmLoading: true });
await saveOrUpdate(values, isUpdate.value);
closeModal();
emit('success');
} finally {
setModalProps({ confirmLoading: false });
}
}
</script>

View File

@@ -0,0 +1,25 @@
import { defHttp } from '/@/utils/http/axios';
enum Api {
list = '/xslmes/mesXslMasterBatchPlan/list',
save = '/xslmes/mesXslMasterBatchPlan/add',
edit = '/xslmes/mesXslMasterBatchPlan/edit',
deleteOne = '/xslmes/mesXslMasterBatchPlan/delete',
deleteBatch = '/xslmes/mesXslMasterBatchPlan/deleteBatch',
queryById = '/xslmes/mesXslMasterBatchPlan/queryById',
exportXls = '/xslmes/mesXslMasterBatchPlan/exportXls',
}
export const list = (params) => defHttp.get({ url: Api.list, params });
export const deleteOne = (params, handleSuccess) =>
defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => handleSuccess());
export const batchDelete = (params, handleSuccess) =>
defHttp.delete({ url: Api.deleteBatch, params }, { joinParamsToUrl: true }).then(() => handleSuccess());
export const saveOrUpdate = (params, isUpdate) => defHttp.post({ url: isUpdate ? Api.edit : Api.save, params });
export const queryById = (params) => defHttp.get({ url: Api.queryById, params });
export const getExportUrl = Api.exportXls;

View File

@@ -0,0 +1,68 @@
import { BasicColumn, FormSchema } from '/@/components/Table';
function statusText(v: unknown) {
if (v === 1) return '进行中';
if (v === 2) return '已完成';
return '未开始';
}
const statusOptions = [
{ label: '未开始', value: 0 },
{ label: '进行中', value: 1 },
{ label: '已完成', value: 2 },
];
export const columns: BasicColumn[] = [
{ title: '订单流水号', align: 'center', dataIndex: 'orderSerialNo', width: 180 },
{ title: '订单编号', align: 'center', dataIndex: 'orderNo', width: 150 },
{ title: '生产段数', align: 'center', dataIndex: 'productionSegmentCount', width: 100 },
{ title: '订单日期', align: 'center', dataIndex: 'orderDate', width: 130 },
{ title: '物料编号', align: 'center', dataIndex: 'materialCode', width: 130 },
{ title: 'MES胶料名称', align: 'center', dataIndex: 'mesMaterialName', width: 150 },
{ title: '计划重量', align: 'center', dataIndex: 'planWeight', width: 110 },
{ title: '每车重量', align: 'center', dataIndex: 'perCarWeight', width: 110 },
{ title: '计划车数', align: 'center', dataIndex: 'plannedCarCount', width: 100 },
{ title: '已排产车数', align: 'center', dataIndex: 'scheduledCarCount', width: 110 },
{ title: '完成车数', align: 'center', dataIndex: 'finishedCarCount', width: 100 },
{ title: '状态', align: 'center', dataIndex: 'status', width: 100, customRender: ({ text }) => statusText(text) },
{ title: '创建人', align: 'center', dataIndex: 'createBy', width: 100 },
{ title: '创建时间', align: 'center', dataIndex: 'createTime', width: 170 },
{ title: '修改人', align: 'center', dataIndex: 'updateBy', width: 100 },
{ title: '修改时间', align: 'center', dataIndex: 'updateTime', width: 170 },
];
export const searchFormSchema: FormSchema[] = [
{ label: '订单流水号', field: 'orderSerialNo', component: 'Input', colProps: { span: 6 } },
{ label: '订单编号', field: 'orderNo', component: 'Input', colProps: { span: 6 } },
{ label: '物料编号', field: 'materialCode', component: 'Input', colProps: { span: 6 } },
{ label: 'MES胶料名称', field: 'mesMaterialName', component: 'Input', colProps: { span: 6 } },
{
label: '状态',
field: 'status',
component: 'Select',
componentProps: { options: statusOptions },
colProps: { span: 6 },
},
];
export const formSchema: FormSchema[] = [
{ label: '', field: 'id', component: 'Input', show: false },
{ label: '', field: 'sourceOrderId', component: 'Input', show: false },
{ label: '订单流水号', field: 'orderSerialNo', component: 'Input', componentProps: { disabled: true } },
{ label: '订单编号', field: 'orderNo', component: 'Input', componentProps: { disabled: true } },
{ label: '生产段数', field: 'productionSegmentCount', component: 'InputNumber', componentProps: { disabled: true } },
{
label: '订单日期',
field: 'orderDate',
component: 'DatePicker',
componentProps: { valueFormat: 'YYYY-MM-DD', style: { width: '100%' }, disabled: true },
},
{ label: '物料编号', field: 'materialCode', component: 'Input', componentProps: { disabled: true } },
{ label: 'MES胶料名称', field: 'mesMaterialName', component: 'Input', componentProps: { disabled: true } },
{ label: '计划重量', field: 'planWeight', component: 'InputNumber', componentProps: { disabled: true } },
{ label: '每车重量', field: 'perCarWeight', component: 'InputNumber', componentProps: { min: 0 } },
{ label: '计划车数', field: 'plannedCarCount', component: 'InputNumber', componentProps: { disabled: true } },
{ label: '已排产车数', field: 'scheduledCarCount', component: 'InputNumber', componentProps: { min: 0, precision: 0 } },
{ label: '完成车数', field: 'finishedCarCount', component: 'InputNumber', componentProps: { min: 0, precision: 0 } },
{ label: '状态', field: 'status', component: 'Select', componentProps: { options: statusOptions } },
];

View File

@@ -0,0 +1,80 @@
<template>
<div>
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<template #tableTitle>
<a-button
type="primary"
v-auth="'xslmes:mes_xsl_master_batch_plan:exportXls'"
preIcon="ant-design:export-outlined"
@click="onExportXls"
>
导出
</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete"><Icon icon="ant-design:delete-outlined" />删除</a-menu-item>
</a-menu>
</template>
<a-button>批量操作<Icon icon="mdi:chevron-down" /></a-button>
</a-dropdown>
</template>
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
</template>
</BasicTable>
<MesXslMasterBatchPlanModal @register="registerModal" @success="handleSuccess" />
</div>
</template>
<script lang="ts" setup>
import { BasicTable, TableAction } from '/@/components/Table';
import { useModal } from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage';
import MesXslMasterBatchPlanModal from './modules/MesXslMasterBatchPlanModal.vue';
import { columns, searchFormSchema } from './MesXslMasterBatchPlan.data';
import { batchDelete, deleteOne, getExportUrl, list } from './MesXslMasterBatchPlan.api';
const [registerModal, { openModal }] = useModal();
const { tableContext, onExportXls } = useListPage({
tableProps: {
title: '母胶计划',
api: list,
columns,
canResize: true,
formConfig: { labelWidth: 100, schemas: searchFormSchema, autoSubmitOnEnter: true, showAdvancedButton: true },
actionColumn: { width: 120, fixed: 'right' },
},
exportConfig: { name: '母胶计划', url: getExportUrl },
});
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
function handleEdit(record: Recordable) {
openModal(true, { record, isUpdate: true, showFooter: true });
}
function handleDetail(record: Recordable) {
openModal(true, { record, isUpdate: true, showFooter: false });
}
async function handleDelete(record) {
await deleteOne({ id: record.id }, reload);
}
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value.join(',') }, reload);
}
function handleSuccess() {
reload();
}
function getTableAction(record) {
return [{ label: '编辑', onClick: handleEdit.bind(null, record), auth: 'xslmes:mes_xsl_master_batch_plan:edit' }];
}
function getDropDownAction(record) {
return [
{ label: '详情', onClick: handleDetail.bind(null, record) },
{
label: '删除',
popConfirm: { title: '是否确认删除', confirm: handleDelete.bind(null, record) },
auth: 'xslmes:mes_xsl_master_batch_plan:delete',
},
];
}
</script>

View File

@@ -0,0 +1,51 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" width="920px" @ok="handleSubmit">
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import { computed, ref, unref } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { BasicForm, useForm } from '/@/components/Form/index';
import { formSchema } from '../MesXslMasterBatchPlan.data';
import { saveOrUpdate } from '../MesXslMasterBatchPlan.api';
const emit = defineEmits(['register', 'success']);
const isUpdate = ref(true);
const isDetail = ref(false);
const [registerForm, { resetFields, setFieldsValue, validate, setProps }] = useForm({
labelWidth: 110,
schemas: formSchema,
showActionButtonGroup: false,
baseColProps: { span: 12 },
});
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
await resetFields();
setModalProps({ confirmLoading: false, showCancelBtn: data?.showFooter, showOkBtn: data?.showFooter });
isUpdate.value = !!data?.isUpdate;
isDetail.value = !data?.showFooter;
if (unref(isUpdate)) {
await setFieldsValue({ ...data.record });
}
setProps({ disabled: !data?.showFooter });
});
const title = computed(() =>
!unref(isUpdate) ? '新增母胶计划' : unref(isDetail) ? '母胶计划详情' : '编辑母胶计划',
);
async function handleSubmit() {
try {
const values = await validate();
setModalProps({ confirmLoading: true });
await saveOrUpdate(values, isUpdate.value);
closeModal();
emit('success');
} finally {
setModalProps({ confirmLoading: false });
}
}
</script>

View File

@@ -7,6 +7,7 @@ enum Api {
deleteOne = '/xslmes/mesXslProductionOrder/delete',
deleteBatch = '/xslmes/mesXslProductionOrder/deleteBatch',
queryById = '/xslmes/mesXslProductionOrder/queryById',
split = '/xslmes/mesXslProductionOrder/split',
exportXls = '/xslmes/mesXslProductionOrder/exportXls',
}
@@ -22,4 +23,7 @@ export const saveOrUpdate = (params, isUpdate) => defHttp.post({ url: isUpdate ?
export const queryById = (params) => defHttp.get({ url: Api.queryById, params });
export const splitToMasterBatchPlan = (params, handleSuccess) =>
defHttp.post({ url: Api.split, params }, { joinParamsToUrl: true }).then(() => handleSuccess());
export const getExportUrl = Api.exportXls;

View File

@@ -34,7 +34,7 @@
import { useListPage } from '/@/hooks/system/useListPage';
import MesXslProductionOrderModal from './modules/MesXslProductionOrderModal.vue';
import { columns, searchFormSchema } from './MesXslProductionOrder.data';
import { batchDelete, deleteOne, getExportUrl, list } from './MesXslProductionOrder.api';
import { batchDelete, deleteOne, getExportUrl, list, splitToMasterBatchPlan } from './MesXslProductionOrder.api';
const [registerModal, { openModal }] = useModal();
const { tableContext, onExportXls } = useListPage({
@@ -65,11 +65,22 @@
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value.join(',') }, reload);
}
async function handleSplit(record) {
await splitToMasterBatchPlan({ id: record.id }, reload);
}
function handleSuccess() {
reload();
}
function getTableAction(record) {
return [{ label: '编辑', onClick: handleEdit.bind(null, record), auth: 'xslmes:mes_xsl_production_order:edit' }];
return [
{ label: '编辑', onClick: handleEdit.bind(null, record), auth: 'xslmes:mes_xsl_production_order:edit' },
{
label: '拆分',
onClick: handleSplit.bind(null, record),
auth: 'xslmes:mes_xsl_production_order:split',
ifShow: () => record.splitStatus !== 1,
},
];
}
function getDropDownAction(record) {
return [