Commit d363e533 by 张恒

feat(scgl): 新增质检流程出入库功能

- 在API中新增入库(Rksq)和质检(Zjsq)接口路径定义
- 实现rksqMesProductOutput和zjsqMesProductOutput两个API函数
- 在页面组件中导入并绑定新的API函数
- 将按钮事件映射扩展到包含入库和质检操作
- 添加handleRksq入库处理函数,包含确认弹窗和成功提示
- 添加handleZjsq质检处理函数,包含确认弹窗和成功提示
- 更新表格按钮配置以支持新的操作类型
parent 7bea6f60
......@@ -8,6 +8,8 @@ enum Api {
List = '/scgl/qclywccmx/list',
Info = '/scgl/qclywccmx/info',
MesQclbgRecordOutput = '/scgl/qclywccmx',
Rksq = '/scgl/qclywccmx/commitRk',
Zjsq = '/scgl/qclywccmx/commitZj',
......@@ -88,6 +90,34 @@ export async function deleteMesQclbgRecordOutput(ids: string[], mode: ErrorMessa
);
}
/**
* @description: 入库
*/
export async function rksqMesProductOutput(params: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.Rksq,
params,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 质检
*/
export async function zjsqMesProductOutput(params: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.Zjsq,
params,
},
{
errorMessageMode: mode,
},
);
}
......@@ -66,7 +66,7 @@
import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
import { getMesQclbgRecordOutputPage, deleteMesQclbgRecordOutput} from '/@/api/scgl/qclywccmx';
import { getMesQclbgRecordOutputPage, deleteMesQclbgRecordOutput, rksqMesProductOutput, zjsqMesProductOutput } from '/@/api/scgl/qclywccmx';
import { ResizePageWrapper } from '/@/components/Page';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
......@@ -145,7 +145,7 @@
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
});
const btnEvent = {view : handleView,delete : handleDelete,}
const btnEvent = {view : handleView,delete : handleDelete,ruku: handleRksq, zhijian: handleZjsq}
const { currentRoute } = useRouter();
......@@ -223,10 +223,62 @@
btnEvent[code]();
}
/**
* @description: 入库
*/
async function handleRksq(record: Recordable) {
try {
Modal.confirm({
title: t('提示信息'),
icon: createVNode(ExclamationCircleOutlined),
content: t('是否提交入库申请?'),
okText: t('确认'),
cancelText: t('取消'),
async onOk() {
await rksqMesProductOutput({ id: record.id });
notification.success({
message: t('成功'),
description: '入库申请成功',
});
handleSuccess();
reload();
},
onCancel() {},
});
} catch (error) {
console.error('入库申请失败:', error);
}
}
/**
* @description: 质检
*/
async function handleZjsq(record: Recordable) {
try {
Modal.confirm({
title: t('提示信息'),
icon: createVNode(ExclamationCircleOutlined),
content: t('是否提交质检申请?'),
okText: t('确认'),
cancelText: t('取消'),
async onOk() {
await zjsqMesProductOutput({ id: record.id });
notification.success({
message: t('成功'),
description: '质检申请成功',
});
handleSuccess();
reload();
},
onCancel() {},
});
} catch (error) {
console.error('质检申请失败:', error);
}
}
......
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