Commit dfcde3c6 by sunhaiwei

生产任务页面添加生成备料单功能

parent 71b72590
......@@ -8,6 +8,7 @@ enum Api {
List = '/scgl/scrw/list',
Info = '/scgl/scrw/info',
MesProductionTask = '/scgl/scrw',
Scbld = '/scgl/scrw/scbld',
......@@ -88,6 +89,23 @@ export async function deleteMesProductionTask(ids: string[], mode: ErrorMessageM
);
}
/**
* 生成备料单
* @param mesProductionTask
* @param mode
*/
export async function generateWarehousePrepare(mesProductionTask: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.Scbld,
params: mesProductionTask,
},
{
errorMessageMode: mode,
},
);
}
......@@ -54,7 +54,11 @@
import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
import { getMesProductionTaskPage, deleteMesProductionTask } from '/@/api/scgl/scrw';
import {
getMesProductionTaskPage,
deleteMesProductionTask,
addMesProductionTask, generateWarehousePrepare
} from '/@/api/scgl/scrw';
import { ResizePageWrapper } from '/@/components/Page';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
......@@ -71,7 +75,7 @@
import Icon from '/@/components/Icon/index';
const listSpliceNum = ref(4); //操作列最先展示几个
const listSpliceNum = ref(3); //操作列最先展示几个
import { useConcurrentLock } from '/@/hooks/web/useConcurrentLock';
......@@ -92,7 +96,7 @@
const tableRef = ref();
//展示在列表内的按钮
const actionButtons = ref<string[]>(['view', 'edit', 'ddzh', 'delete']);
const actionButtons = ref<string[]>(['view', 'edit', 'ddzh', 'delete','scbld']);
const buttonConfigs = computed(() => {
const list = [
{
......@@ -121,6 +125,15 @@
isEnableLock: true,
},
{
buttonId: '2136613468518433899',
name: '生成备料单',
code: 'scbld',
icon: 'ant-design:form-outlined',
isDefault: true,
isUse: true,
isEnableLock: true,
},
{
buttonId: '2008813468518432771',
name: '打印',
code: 'sclld',
......@@ -204,7 +217,7 @@
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
});
const btnEvent = { view: handleView, add: handleAdd, edit: handleEdit, delete: handleDelete };
const btnEvent = { view: handleView, add: handleAdd, edit: handleEdit, delete: handleDelete,scbld:handleBld };
const { currentRoute } = useRouter();
......@@ -266,6 +279,32 @@
openModal(true, { isUpdate: false });
}
function handleBld(record: Recordable) {
Modal.confirm({
title: t('提示信息'),
icon: createVNode(ExclamationCircleOutlined),
content: t('是否生成备料单?'),
okText: t('确认'),
cancelText: t('取消'),
async onOk() {
let result = await generateWarehousePrepare(record);
if (result) {
handleSuccess();
notification.success({
message: 'Tip',
description: '生成成功!',
});
} else {
notification.warning({
message: 'Tip',
description: '任务编号已存在!',
});
}
},
onCancel() {},
});
}
async function handleEdit(record: Recordable) {
const hasNonDraft = record.zt !== '草稿' && record.zt !== '未开始';
if (hasNonDraft) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment