|
@@ -92,13 +92,13 @@ function Detail(props) {
|
|
if (version?.flow_id && auditList?.length > 0) {
|
|
if (version?.flow_id && auditList?.length > 0) {
|
|
let item = auditList.find(item => item.list.id == version.flow_id);
|
|
let item = auditList.find(item => item.list.id == version.flow_id);
|
|
if (!item) return data;
|
|
if (!item) return data;
|
|
- // 合并同审批级别项
|
|
|
|
- let nodes = {};
|
|
|
|
- item.list.FlowNodes.map(item => {
|
|
|
|
- if (!nodes[item.seq]) nodes[item.seq] = { ...item, user: [] };
|
|
|
|
- nodes[item.seq].user.push(item.AuditorUser);
|
|
|
|
- });
|
|
|
|
- item.list.FlowNodes = Object.values(nodes);
|
|
|
|
|
|
+ // // 合并同审批级别项
|
|
|
|
+ // let nodes = {};
|
|
|
|
+ // item.list.FlowNodes.map(item => {
|
|
|
|
+ // if (!nodes[item.seq]) nodes[item.seq] = { ...item, user: [] };
|
|
|
|
+ // nodes[item.seq].user.push(item.AuditorUser);
|
|
|
|
+ // });
|
|
|
|
+ // item.list.FlowNodes = Object.values(nodes);
|
|
// 查询当前节点
|
|
// 查询当前节点
|
|
let current = item.list.FlowNodes.findIndex(node => node.seq == item.active);
|
|
let current = item.list.FlowNodes.findIndex(node => node.seq == item.active);
|
|
item.current = current == -1 ? 0 : current;
|
|
item.current = current == -1 ? 0 : current;
|
|
@@ -113,7 +113,9 @@ function Detail(props) {
|
|
|
|
|
|
const isAuditor = useMemo(() => {
|
|
const isAuditor = useMemo(() => {
|
|
const getUserRole = () => {
|
|
const getUserRole = () => {
|
|
- let item = flow.currentNode?.user?.find?.(item => item.ID == currentUser.ID);
|
|
|
|
|
|
+ let roleID = flow.currentNode?.AuditRoleInfo?.ID;
|
|
|
|
+ let item = currentUser.Permissions.find(role => role.RoleId == roleID);
|
|
|
|
+ //.find?.(item => item.ID == currentUser.ID);
|
|
if (item) return true;
|
|
if (item) return true;
|
|
return false;
|
|
return false;
|
|
};
|
|
};
|
|
@@ -878,7 +880,7 @@ function Detail(props) {
|
|
const nodeId = version.template_node_id;
|
|
const nodeId = version.template_node_id;
|
|
if (!flowDetail?.nodes || !nodeId) return;
|
|
if (!flowDetail?.nodes || !nodeId) return;
|
|
const node = flowDetail.nodes.find(item => item.Id == nodeId);
|
|
const node = flowDetail.nodes.find(item => item.Id == nodeId);
|
|
- return `当前节点:${node?.label || '-'}`;
|
|
|
|
|
|
+ return `当前版本:${version.version_name || '-'}; 当前节点:${node?.label || '-'}`;
|
|
};
|
|
};
|
|
|
|
|
|
const handleSubmitCell = (value, callback) => {
|
|
const handleSubmitCell = (value, callback) => {
|
|
@@ -998,17 +1000,18 @@ function Detail(props) {
|
|
</Option>
|
|
</Option>
|
|
))}
|
|
))}
|
|
</Select> */}
|
|
</Select> */}
|
|
- {/* {flow?.active == 0 && ( */}
|
|
|
|
<Button type="primary" onClick={() => setFlowVisible(true)}>
|
|
<Button type="primary" onClick={() => setFlowVisible(true)}>
|
|
查看流程
|
|
查看流程
|
|
</Button>
|
|
</Button>
|
|
- <Button
|
|
|
|
- type="primary"
|
|
|
|
- icon={<PlusOutlined onClick={() => setVersionVisible(true)} />}
|
|
|
|
- onClick={() => setVersionVisible(true)}
|
|
|
|
- ></Button>
|
|
|
|
|
|
|
|
- {/* )} */}
|
|
|
|
|
|
+ {/* 非审批节点可以创建版本 */}
|
|
|
|
+ {flow?.active == 0 && (
|
|
|
|
+ <Button
|
|
|
|
+ type="primary"
|
|
|
|
+ icon={<PlusOutlined onClick={() => setVersionVisible(true)} />}
|
|
|
|
+ onClick={() => setVersionVisible(true)}
|
|
|
|
+ ></Button>
|
|
|
|
+ )}
|
|
<span style={{ marginLeft: 20 }}>{renderNode()}</span>
|
|
<span style={{ marginLeft: 20 }}>{renderNode()}</span>
|
|
</div>
|
|
</div>
|
|
<div className={styles.btns}>
|
|
<div className={styles.btns}>
|