Commit 399845b9 authored by 涂伟's avatar 涂伟

fix: '工单事件删除逻辑优化,提示内容优化'

parent 657b7168
Pipeline #96736 failed with stages
...@@ -51,6 +51,9 @@ import { ...@@ -51,6 +51,9 @@ import {
ImportEventConfig, ImportEventConfig,
ExportEventConfig, ExportEventConfig,
} from '@/services/standingBook/api'; } from '@/services/standingBook/api';
import {
GetFlowCaseNum
} from '@/services/workflow/workflow';
import classnames from 'classnames'; import classnames from 'classnames';
import styles from './incident.less'; import styles from './incident.less';
import AddModal from './AddModal'; import AddModal from './AddModal';
...@@ -93,6 +96,7 @@ const incident = () => { ...@@ -93,6 +96,7 @@ const incident = () => {
const [showSearchStyle, setShowSearchStyle] = useState(false); // 是否显示模糊查询样式 const [showSearchStyle, setShowSearchStyle] = useState(false); // 是否显示模糊查询样式
const [addForm] = Form.useForm(); const [addForm] = Form.useForm();
const [file, setFile] = useState(); // 上传文件信息 const [file, setFile] = useState(); // 上传文件信息
const [caseCount, setCaseCount] = useState(0); // 事件相关工单数量
const columns = [ const columns = [
{ {
...@@ -241,13 +245,14 @@ const incident = () => { ...@@ -241,13 +245,14 @@ const incident = () => {
</Tooltip> </Tooltip>
<Tooltip title="删除事件"> <Tooltip title="删除事件">
<Popconfirm <Popconfirm
// visible={showDeletePop}
placement="bottomRight" placement="bottomRight"
title={<p>即将删除事件类型表,是否确认删除?</p>} title={<p>此事件有{caseCount}条工单,删除事件后会删除对应的工单,请谨慎操作。</p>}
okText="确认" okText="确认"
cancelText="取消" cancelText="取消"
onConfirm={() => deleteEventType(record)} onConfirm={() => deleteEventType(record)}
> >
<DeleteOutlined style={{ fontSize: '16px', color: '#e86060' }} /> <DeleteOutlined onClick={() => getCaseCount(record.name)} style={{ fontSize: '16px', color: '#e86060' }} />
</Popconfirm> </Popconfirm>
</Tooltip> </Tooltip>
</Space> </Space>
...@@ -255,6 +260,13 @@ const incident = () => { ...@@ -255,6 +260,13 @@ const incident = () => {
}, },
]; ];
const getCaseCount = async (eventName) => {
let res = await GetFlowCaseNum({eventName})
if(res.code === 0) {
setCaseCount(res.data)
}
}
useEffect(() => { useEffect(() => {
setTreeLoading(true); setTreeLoading(true);
GetCM_Event_LoadEventTable({ GetCM_Event_LoadEventTable({
...@@ -262,7 +274,7 @@ const incident = () => { ...@@ -262,7 +274,7 @@ const incident = () => {
}).then(res => { }).then(res => {
setTreeLoading(false); setTreeLoading(false);
if (res.code === 0) { if (res.code === 0) {
if(!searchValue) { if (!searchValue) {
setBusinessType(res.data) setBusinessType(res.data)
} }
setKeepIdValue(res.data); setKeepIdValue(res.data);
...@@ -307,7 +319,7 @@ const incident = () => { ...@@ -307,7 +319,7 @@ const incident = () => {
setRember1(newArr[0]); setRember1(newArr[0]);
} }
setTreeData(newArr); setTreeData(newArr);
if(!searchValue) { if (!searchValue) {
setModalTreeData(newArr) setModalTreeData(newArr)
} }
} else { } else {
......
...@@ -23,6 +23,7 @@ import { ...@@ -23,6 +23,7 @@ import {
DeleteFlow, DeleteFlow,
CheckDoingFlowNodes, CheckDoingFlowNodes,
CloseDoingFlowNodes, CloseDoingFlowNodes,
GetFlowCaseNum
} from '@/services/workflow/workflow'; } from '@/services/workflow/workflow';
import { DownLoadFiles } from '@/services/common/api'; import { DownLoadFiles } from '@/services/common/api';
import { UpdateFlowGroup } from '@/services/workflow/workflow'; import { UpdateFlowGroup } from '@/services/workflow/workflow';
...@@ -255,13 +256,15 @@ const WorkflowHomePage = () => { ...@@ -255,13 +256,15 @@ const WorkflowHomePage = () => {
// 删除流程 // 删除流程
const delFlow = async (val, e) => { const delFlow = async (val, e) => {
e.stopPropagation(); e.stopPropagation();
let res1 = await CheckDoingFlowNodes({ flowID: val.FlowID }); let res1 = await GetFlowCaseNum({ flowID: val.FlowID });
console.log(res1,'res111111111111111111111');
if (res1.code === 0) { if (res1.code === 0) {
if (res1.data > 0) { if (res1.data > 0) {
confirm({ confirm({
title: '确定要删除当前流程吗?', title: '确定要删除当前流程吗?',
icon: <ExclamationCircleOutlined />, icon: <ExclamationCircleOutlined />,
content: <div>当前流程有{res1.data}条在办工单,确定删除会自动归档在办工单</div>, content: <div>此流程有{res1.data}条工单,删除流程后会删除对应的工单,请谨慎操作</div>,
okText: '是', okText: '是',
okType: 'danger', okType: 'danger',
cancelText: '否', cancelText: '否',
...@@ -406,6 +409,7 @@ const WorkflowHomePage = () => { ...@@ -406,6 +409,7 @@ const WorkflowHomePage = () => {
</Anchor> */} </Anchor> */}
<div className={styles.tabBox}> <div className={styles.tabBox}>
{flowList.map((item, index) => ( {flowList.map((item, index) => (
<Tooltip title={`${item.name}(${item.count})`}>
<div <div
className={classnames(styles.tab, { className={classnames(styles.tab, {
[styles.activeTab]: item.name === activeKey.current, [styles.activeTab]: item.name === activeKey.current,
...@@ -415,6 +419,8 @@ const WorkflowHomePage = () => { ...@@ -415,6 +419,8 @@ const WorkflowHomePage = () => {
> >
{item.name}({item.count}) {item.name}({item.count})
</div> </div>
</Tooltip>
))} ))}
</div> </div>
{/* <Tabs activeKey={activeKey.current} type="card" onChange={onChange} animated={false}> {/* <Tabs activeKey={activeKey.current} type="card" onChange={onChange} animated={false}>
......
...@@ -52,3 +52,6 @@ export const CheckDoingFlowNodes = param => ...@@ -52,3 +52,6 @@ export const CheckDoingFlowNodes = param =>
// 一键关单接口 // 一键关单接口
export const CloseDoingFlowNodes = param => export const CloseDoingFlowNodes = param =>
post(`${PUBLISH_SERVICE}/WorkFlow/CloseDoingFlowNodes`, param); post(`${PUBLISH_SERVICE}/WorkFlow/CloseDoingFlowNodes`, param);
// 检查流程和事件的工单
export const GetFlowCaseNum = param =>
get(`${PUBLISH_SERVICE}/WorkFlow/GetFlowCaseNum`, param);
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