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

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

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