Commit 9ea285cd by li.jian

生产计划在生产任务执行前增加撤回操作。

parent 208821f1
...@@ -9,6 +9,7 @@ enum Api { ...@@ -9,6 +9,7 @@ enum Api {
Info = '/scgl/scjh/info', Info = '/scgl/scjh/info',
MesProductionPlan = '/scgl/scjh', MesProductionPlan = '/scgl/scjh',
Issue = '/scgl/scjh/issue', Issue = '/scgl/scjh/issue',
recall = '/scgl//scrw/recall',
} }
/** /**
...@@ -100,3 +101,18 @@ export async function issueMesProductionPlan(ids: string[], mode: ErrorMessageMo ...@@ -100,3 +101,18 @@ export async function issueMesProductionPlan(ids: string[], mode: ErrorMessageMo
}, },
); );
} }
/**
* @description: 撤回任务
*/
export async function recallMesProductionPlan(jhbhs: string , mode: ErrorMessageMode = 'modal') {
return defHttp.get<boolean>(
{
url: Api.recall,
params: { jhbhs },
},
{
errorMessageMode: mode,
},
);
}
...@@ -1009,7 +1009,7 @@ export const formProps: FormProps = { ...@@ -1009,7 +1009,7 @@ export const formProps: FormProps = {
defaultValue: 0, defaultValue: 0,
min: 0, min: 0,
step: 0.01, step: 0.01,
disabled: true, disabled: false,
showLabel: true, showLabel: true,
controls: true, controls: true,
required: false, required: false,
...@@ -1035,7 +1035,7 @@ export const formProps: FormProps = { ...@@ -1035,7 +1035,7 @@ export const formProps: FormProps = {
defaultValue: 0, defaultValue: 0,
min: 0, min: 0,
step: 0.01, step: 0.01,
disabled: true, disabled: false,
showLabel: true, showLabel: true,
controls: true, controls: true,
required: false, required: false,
......
...@@ -73,6 +73,7 @@ ...@@ -73,6 +73,7 @@
getMesProductionPlanPage, getMesProductionPlanPage,
deleteMesProductionPlan, deleteMesProductionPlan,
issueMesProductionPlan, issueMesProductionPlan,
recallMesProductionPlan,
} from '/@/api/scgl/scjh'; } from '/@/api/scgl/scjh';
import { ResizePageWrapper } from '/@/components/Page'; import { ResizePageWrapper } from '/@/components/Page';
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
...@@ -145,52 +146,12 @@ ...@@ -145,52 +146,12 @@
//展示在列表内的按钮 //展示在列表内的按钮
const actionButtons = ref<string[]>(['view', 'edit', 'delete']); const actionButtons = ref<string[]>(['view', 'edit', 'delete']);
const buttonConfigs = computed(() => { const buttonConfigs = computed(() => {
const list = [ const list = [{"buttonId":"2004396569122545664","name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},
{ {"buttonId":"2004396569122545665","name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true},
buttonId: '2004396569122545664', {"buttonId":"2004396569122545666","name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true,"isEnableLock":true},
name: '查看', {"buttonId":"2004471125057142784","name":"下发任务","code":"xiafa","icon":"ant-design:export-outlined","isDefault":false,"isUse":true,"setting":[],"showType":"top","buttonType":"primary"},
code: 'view', {"isUse":true,"name":"撤回","code":"chehui","icon":"ant-design:loading-3-quarters-outlined","isDefault":false,"setting":[],"showType":"top","buttonType":"primary"},
icon: 'ant-design:eye-outlined', {"buttonId":"2004396569122545667","name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]
isDefault: true,
isUse: true,
},
{
buttonId: '2004396569122545665',
name: '新增',
code: 'add',
icon: 'ant-design:plus-outlined',
isDefault: true,
isUse: true,
},
{
buttonId: '2004396569122545666',
name: '编辑',
code: 'edit',
icon: 'ant-design:form-outlined',
isDefault: true,
isUse: true,
isEnableLock: true,
},
{
buttonId: '2004471125057142784',
name: '下发任务',
code: 'xiafa',
icon: 'ant-design:export-outlined',
isDefault: false,
isUse: true,
setting: [],
showType: 'top',
buttonType: 'primary',
},
{
buttonId: '2004396569122545667',
name: '删除',
code: 'delete',
icon: 'ant-design:delete-outlined',
isDefault: true,
isUse: true,
},
];
return filterButtonAuth(list); return filterButtonAuth(list);
}); });
...@@ -208,6 +169,7 @@ ...@@ -208,6 +169,7 @@
edit: handleEdit, edit: handleEdit,
delete: handleDelete, delete: handleDelete,
xiafa: handleXiafa, xiafa: handleXiafa,
chehui: handleChehui,
}; };
const { currentRoute } = useRouter(); const { currentRoute } = useRouter();
...@@ -441,6 +403,52 @@ ...@@ -441,6 +403,52 @@
}); });
} }
function handleChehui(record: Recordable) {
Modal.confirm({
title: t('提示信息'),
icon: createVNode(ExclamationCircleOutlined),
content: t('是否撤回?'),
okText: t('确认'),
cancelText: t('取消'),
async onOk() {
if (selectedKeys.value.length === 0) {
Modal.warning({
title: '提示',
content: '请选择计划',
});
return;
}
if (selectedKeys.value.length > 1) {
Modal.warning({
title: '提示',
content: '请选择一个计划',
});
return;
}
const hasNonDraft = selectedRowsData.value.some((item) => item.zt === '已完工');
if (hasNonDraft) {
Modal.warning({
title: '提示',
content: '已完工计划无法撤回',
});
return;
}
const jhbhs = selectedRowsData.value.map((x) => x.jhbh);
console.log(jhbhs);
recallMesProductionPlan(jhbhs[0]).then((_) => {
handleSuccess();
notification.success({
message: 'Tip',
description: '撤回成功!',
});
});
},
onCancel() {},
});
}
function getLessActions(record: Recordable) { function getLessActions(record: Recordable) {
let list = getActions(record); let list = getActions(record);
return list.slice(0, listSpliceNum.value); return list.slice(0, listSpliceNum.value);
......
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