生产环节优化
This commit is contained in:
@@ -8,6 +8,7 @@ enum Api {
|
||||
deleteBatch = '/xslmes/mesXslProductionOrder/deleteBatch',
|
||||
queryById = '/xslmes/mesXslProductionOrder/queryById',
|
||||
split = '/xslmes/mesXslProductionOrder/split',
|
||||
splitBatch = '/xslmes/mesXslProductionOrder/splitBatch',
|
||||
exportXls = '/xslmes/mesXslProductionOrder/exportXls',
|
||||
}
|
||||
|
||||
@@ -26,4 +27,7 @@ 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 splitToMasterBatchPlanBatch = (params, handleSuccess) =>
|
||||
defHttp.post({ url: Api.splitBatch, params }, { joinParamsToUrl: true }).then(() => handleSuccess());
|
||||
|
||||
export const getExportUrl = Api.exportXls;
|
||||
|
||||
@@ -11,6 +11,15 @@
|
||||
>
|
||||
导出
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-auth="'xslmes:mes_xsl_production_order:split'"
|
||||
preIcon="ant-design:split-cells-outlined"
|
||||
:disabled="selectedRowKeys.length === 0"
|
||||
@click="handleBatchSplit"
|
||||
>
|
||||
拆分
|
||||
</a-button>
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
@@ -32,11 +41,14 @@
|
||||
import { BasicTable, TableAction } from '/@/components/Table';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { Modal } from 'ant-design-vue';
|
||||
import MesXslProductionOrderModal from './modules/MesXslProductionOrderModal.vue';
|
||||
import { columns, searchFormSchema } from './MesXslProductionOrder.data';
|
||||
import { batchDelete, deleteOne, getExportUrl, list, splitToMasterBatchPlan } from './MesXslProductionOrder.api';
|
||||
import { batchDelete, deleteOne, getExportUrl, list, splitToMasterBatchPlanBatch } from './MesXslProductionOrder.api';
|
||||
|
||||
const [registerModal, { openModal }] = useModal();
|
||||
const { createMessage } = useMessage();
|
||||
const { tableContext, onExportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '生产订单',
|
||||
@@ -65,8 +77,25 @@
|
||||
async function batchHandleDelete() {
|
||||
await batchDelete({ ids: selectedRowKeys.value.join(',') }, reload);
|
||||
}
|
||||
async function handleSplit(record) {
|
||||
await splitToMasterBatchPlan({ id: record.id }, reload);
|
||||
async function handleBatchSplit() {
|
||||
if (!selectedRowKeys.value.length) {
|
||||
createMessage.warning('请先勾选要拆分的生产订单');
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '确认批量拆分',
|
||||
content: `将拆分 ${selectedRowKeys.value.length} 条生产订单,是否继续?`,
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: async () => {
|
||||
try {
|
||||
await splitToMasterBatchPlanBatch({ ids: selectedRowKeys.value.join(',') }, reload);
|
||||
createMessage.success('批量拆分成功');
|
||||
} catch (e: any) {
|
||||
createMessage.error(e?.message || '批量拆分失败');
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
function handleSuccess() {
|
||||
reload();
|
||||
@@ -74,12 +103,6 @@
|
||||
function getTableAction(record) {
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user