Commit 04272107 by 宋春膨

fix(scjh): 解决任务重复下发问题

- 添加状态检查逻辑避免重复下发任务
- 当选中项中存在已下发状态的任务时阻止提交
- 添加警告提示告知用户请勿重复下发任务
- 保持原有下发功能逻辑不变
parent 04990a39
...@@ -207,25 +207,35 @@ ...@@ -207,25 +207,35 @@
const store = useUserStore() const store = useUserStore()
const ids = selectedRowsData.value.map((x) => x.id) const ids = selectedRowsData.value.map((x) => x.id)
if (code === 'xiafa') { if (code === 'xiafa') {
Modal.confirm({ //如果状态是已下发就直接禁止提交 提示警告
title: '提示信息', if (selectedRowsData.value.some((x) => x.status === '已下发')) {
icon: createVNode(ExclamationCircleOutlined), notification.warning({
content: '是否确认下发任务?', message: '提示信息',
okText: '确认', description: '请勿重复下发任务!',
cancelText: '取消', });
onOk() { return;
axios }else{
.post('http://localhost:8053/scgl/scjh/issue', { ids } , {headers: { Authorization: 'Bearer '+store.getToken } }) Modal.confirm({
.then((res) => { title: '提示信息',
if (res.data === '下发成功') { icon: createVNode(ExclamationCircleOutlined),
notification.success({ content: '是否确认下发任务?',
message: '提示信息', okText: '确认',
description: res.data, cancelText: '取消',
onOk() {
axios
.post('http://localhost:8053/scgl/scjh/issue', { ids } , {headers: { Authorization: 'Bearer '+store.getToken } })
.then((res) => {
if (res.data === '下发成功') {
notification.success({
message: '提示信息',
description: res.data,
});
}
}); });
} },
}); });
},
}); }
} }
btnEvent[code](); btnEvent[code]();
......
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