Commit 787a58ae by sunhaiwei

生产计划和生产任务删除的时候添加校验

parent 429ad3de
......@@ -121,6 +121,7 @@
import { useConcurrentLock } from '/@/hooks/web/useConcurrentLock';
import {rksqMesProductOutput} from "/@/api/scgl/ccmx";
import {useUserStore} from "/@/store/modules/user";
const pageParamsInfo = ref<any>({});
const {
......@@ -284,10 +285,16 @@
function handleDelete(record: Recordable) {
deleteList([record.id]);
deleteList([record.id],record);
}
function deleteList(ids) {
const userStore = useUserStore();
function deleteList(ids,record) {
//当前登录人的id
let userId = userStore.getUserInfo.id;
//创建人的id
let createUserId = record.createUserId;
Modal.confirm({
title: '提示信息',
icon: createVNode(ExclamationCircleOutlined),
......@@ -295,6 +302,8 @@
okText: '确认',
cancelText: '取消',
onOk() {
if (userId==createUserId) {
if (record.zt!='已下发') {
deleteMesProductionPlan(ids).then((_) => {
handleSuccess();
notification.success({
......@@ -302,6 +311,18 @@
description: t('删除成功!'),
});
});
} else {
notification.warning({
message: 'Tip',
description: t('已下发的计划不能删除!'),
});
}
} else {
notification.warning({
message: 'Tip',
description: t('不是本人的计划不能删除!'),
});
}
},
onCancel() {},
});
......
......@@ -113,6 +113,7 @@
import { useConcurrentLock } from '/@/hooks/web/useConcurrentLock';
import {recallMesProductionPlan, revokeMesProductionTask} from "/@/api/scgl/scjh";
import {useUserStore} from "/@/store/modules/user";
const pageParamsInfo = ref<any>({});
const { enableLockeData,handleOpenFormEnableLockeData, handleCloseFormEnableLocke, handleHasEnableLocke } =
......@@ -271,7 +272,7 @@
function handleDelete(record: Recordable) {
deleteList([record.id]);
deleteList([record.id],record);
}
function handleBack(record: Recordable) {
......@@ -302,8 +303,13 @@
onCancel() {},
});
}
const userStore = useUserStore();
function deleteList(ids) {
function deleteList(ids,record) {
//当前登录人的id
let userId = userStore.getUserInfo.id;
//创建人的id
let createUserId = record.createUserId;
Modal.confirm({
title: '提示信息',
icon: createVNode(ExclamationCircleOutlined),
......@@ -311,6 +317,8 @@
okText: '确认',
cancelText: '取消',
onOk() {
if (userId==createUserId) {
if (record.zt=='草稿') {
deleteMesProductionTask(ids).then((_) => {
handleSuccess();
notification.success({
......@@ -318,6 +326,18 @@
description: t('删除成功!'),
});
});
} else {
notification.warning({
message: 'Tip',
description: t('已进行的任务不能删除!'),
});
}
} else {
notification.warning({
message: 'Tip',
description: t('不是本人的任务不能删除!'),
});
}
},
onCancel() {},
});
......
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