|
@@ -25,6 +25,7 @@ import {
|
|
queryDelPurchaseExcel,
|
|
queryDelPurchaseExcel,
|
|
queryDingInstanceDetail,
|
|
queryDingInstanceDetail,
|
|
queryRecordSheet,
|
|
queryRecordSheet,
|
|
|
|
+ queryTrySeal,
|
|
queryVserionByNode,
|
|
queryVserionByNode,
|
|
} from '@/services/boom';
|
|
} from '@/services/boom';
|
|
import { async } from '@antv/x6/lib/registry/marker/async';
|
|
import { async } from '@antv/x6/lib/registry/marker/async';
|
|
@@ -72,6 +73,11 @@ function FlowModal(props) {
|
|
const [selectType, setSelectType] = useState(SELECT_TYPE.NAME);
|
|
const [selectType, setSelectType] = useState(SELECT_TYPE.NAME);
|
|
const [inputValue, setInputValue] = useState('');
|
|
const [inputValue, setInputValue] = useState('');
|
|
|
|
|
|
|
|
+ const [sealLoading, setSealLoading] = useState(false);
|
|
|
|
+ // const [currentTempNodeId, setCurrentTempNodeId] = useState();
|
|
|
|
+ const currentTempNodeId = useRef();
|
|
|
|
+ console.log('=======', currentTempNodeId);
|
|
|
|
+
|
|
const graphData = useMemo(() => {
|
|
const graphData = useMemo(() => {
|
|
if (!flowDetail) return;
|
|
if (!flowDetail) return;
|
|
let nodes = flowDetail.nodes?.map(item => ({
|
|
let nodes = flowDetail.nodes?.map(item => ({
|
|
@@ -96,14 +102,19 @@ function FlowModal(props) {
|
|
}
|
|
}
|
|
}, [stepsData]);
|
|
}, [stepsData]);
|
|
|
|
|
|
- const handleSelectNode = async args => {
|
|
|
|
- let res;
|
|
|
|
|
|
+ const handleSelectNode = args => {
|
|
const id = args.nodeId || args.nodeIds[0];
|
|
const id = args.nodeId || args.nodeIds[0];
|
|
if (!id) return;
|
|
if (!id) return;
|
|
let node = graphData.nodes.find(item => item.id == id);
|
|
let node = graphData.nodes.find(item => item.id == id);
|
|
|
|
+ initData(node.Id);
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ const initData = async template_node_id => {
|
|
setNodeLoading(true);
|
|
setNodeLoading(true);
|
|
try {
|
|
try {
|
|
- res = await queryVserionByNode({ template_node_id: node.Id });
|
|
|
|
|
|
+ const res = await queryVserionByNode({
|
|
|
|
+ template_node_id: template_node_id,
|
|
|
|
+ });
|
|
let data = [];
|
|
let data = [];
|
|
if (!res.data.excel_version_tree) setData([]);
|
|
if (!res.data.excel_version_tree) setData([]);
|
|
res.data.excel_version_tree?.map(arr => {
|
|
res.data.excel_version_tree?.map(arr => {
|
|
@@ -120,6 +131,7 @@ function FlowModal(props) {
|
|
item.isParent = true;
|
|
item.isParent = true;
|
|
});
|
|
});
|
|
console.log(data);
|
|
console.log(data);
|
|
|
|
+ currentTempNodeId.current = template_node_id;
|
|
setData(data);
|
|
setData(data);
|
|
} catch (error) {
|
|
} catch (error) {
|
|
console.log(error);
|
|
console.log(error);
|
|
@@ -180,7 +192,7 @@ function FlowModal(props) {
|
|
return [
|
|
return [
|
|
{
|
|
{
|
|
title: '名称',
|
|
title: '名称',
|
|
- width: '25%',
|
|
|
|
|
|
+ width: '20%',
|
|
render: item => (
|
|
render: item => (
|
|
<span style={{ color: item.audit_status != 0 ? '#9b9b9b' : '' }}>
|
|
<span style={{ color: item.audit_status != 0 ? '#9b9b9b' : '' }}>
|
|
{item.id == version.id && !item.isParent && (
|
|
{item.id == version.id && !item.isParent && (
|
|
@@ -259,99 +271,34 @@ function FlowModal(props) {
|
|
},
|
|
},
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: '操作',
|
|
|
|
- width: '20%',
|
|
|
|
- render: item =>
|
|
|
|
- (item.flow_id || !item.isParent) &&
|
|
|
|
- item.id != version.id && (
|
|
|
|
- <Space>
|
|
|
|
- <a
|
|
|
|
- onClick={() => {
|
|
|
|
- console.log(item);
|
|
|
|
- onChangeVersion(item);
|
|
|
|
- onClose();
|
|
|
|
- }}
|
|
|
|
- >
|
|
|
|
- 加载
|
|
|
|
- </a>
|
|
|
|
- {item.audit_status == 0 &&
|
|
|
|
- item.author == currentUser.ID && ( //自己创建的&&未提交的清单自己可以删除
|
|
|
|
- <a
|
|
|
|
- onClick={() => {
|
|
|
|
- onDelVersion({ excel_id: item.id });
|
|
|
|
- }}
|
|
|
|
- >
|
|
|
|
- 删除
|
|
|
|
- </a>
|
|
|
|
- )}
|
|
|
|
- </Space>
|
|
|
|
- ),
|
|
|
|
- },
|
|
|
|
- ];
|
|
|
|
- }, [version]);
|
|
|
|
-
|
|
|
|
- const childColumns = useMemo(() => {
|
|
|
|
- return [
|
|
|
|
- {
|
|
|
|
- title: '名称',
|
|
|
|
- width: '50%',
|
|
|
|
- render: item => (
|
|
|
|
- <span style={{ color: item.audit_status != 0 ? '#9b9b9b' : '' }}>
|
|
|
|
- {item.id == version.id && !item.isParent && (
|
|
|
|
- <CheckOutlined style={{ marginRight: 10 }} />
|
|
|
|
- )}
|
|
|
|
- {item.version_no && !item.children?.length
|
|
|
|
- ? `${item.version_name}.${item.version_no}`
|
|
|
|
- : item.version_name}
|
|
|
|
- </span>
|
|
|
|
- ),
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '状态',
|
|
|
|
|
|
+ title: '印章申请',
|
|
|
|
+ width: '15%',
|
|
render: item => {
|
|
render: item => {
|
|
if (!item.flow_id && item.isParent) return;
|
|
if (!item.flow_id && item.isParent) return;
|
|
- let style = { color: getColor(item) };
|
|
|
|
let txt = '';
|
|
let txt = '';
|
|
- let dom = '';
|
|
|
|
- switch (item.audit_status) {
|
|
|
|
|
|
+ //申请印章成功 1 默认0 失败2
|
|
|
|
+ switch (item.is_seal_succeed) {
|
|
case 0:
|
|
case 0:
|
|
- txt = '未提交';
|
|
|
|
|
|
+ txt = '-';
|
|
break;
|
|
break;
|
|
case 1:
|
|
case 1:
|
|
- txt = '待审批';
|
|
|
|
|
|
+ txt = '成功';
|
|
break;
|
|
break;
|
|
case 2:
|
|
case 2:
|
|
- txt = '已拒绝';
|
|
|
|
- break;
|
|
|
|
- case 3:
|
|
|
|
- txt = '已通过';
|
|
|
|
- break;
|
|
|
|
- case 4:
|
|
|
|
- txt = '已提交';
|
|
|
|
|
|
+ txt = '失败';
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- if (item.status == 1) txt = '已失效';
|
|
|
|
-
|
|
|
|
- // 显示拒绝原因
|
|
|
|
- if (item.audit_comment) {
|
|
|
|
- dom = (
|
|
|
|
- <Popover content={item.audit_comment} title="原因">
|
|
|
|
- {txt}
|
|
|
|
- </Popover>
|
|
|
|
- );
|
|
|
|
- } else {
|
|
|
|
- dom = txt;
|
|
|
|
- }
|
|
|
|
- return item.audit_status != 0 ? (
|
|
|
|
- <Button onClick={() => handleChangeClick(item)}>{dom}</Button>
|
|
|
|
- ) : (
|
|
|
|
- <span style={style}>{dom}</span>
|
|
|
|
|
|
+ return (
|
|
|
|
+ <Space>
|
|
|
|
+ <span>{txt}</span>
|
|
|
|
+ {item.is_seal_succeed == 2 && <a onClick={() => handleRetryClick(item.id)}>重试</a>}
|
|
|
|
+ </Space>
|
|
);
|
|
);
|
|
},
|
|
},
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '操作',
|
|
title: '操作',
|
|
- width: '30%',
|
|
|
|
|
|
+ width: '20%',
|
|
render: item =>
|
|
render: item =>
|
|
(item.flow_id || !item.isParent) &&
|
|
(item.flow_id || !item.isParent) &&
|
|
item.id != version.id && (
|
|
item.id != version.id && (
|
|
@@ -381,6 +328,18 @@ function FlowModal(props) {
|
|
];
|
|
];
|
|
}, [version]);
|
|
}, [version]);
|
|
|
|
|
|
|
|
+ const handleRetryClick = async id => {
|
|
|
|
+ setNodeLoading(true);
|
|
|
|
+ const res = await queryTrySeal({ excel_id: id });
|
|
|
|
+ setNodeLoading(false);
|
|
|
|
+ if (res.data?.errcode != 0) {
|
|
|
|
+ message.error(res.data?.errmsg);
|
|
|
|
+ } else {
|
|
|
|
+ message.success('用印成功');
|
|
|
|
+ if (currentTempNodeId.current) initData(currentTempNodeId.current);
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+
|
|
const onChange = value => {
|
|
const onChange = value => {
|
|
updateSteps([]);
|
|
updateSteps([]);
|
|
};
|
|
};
|