|
@@ -22,14 +22,29 @@ function Audit(props) {
|
|
formData,
|
|
formData,
|
|
flowDetail,
|
|
flowDetail,
|
|
simpleFlowDteail,
|
|
simpleFlowDteail,
|
|
|
|
+ currentUser
|
|
} = props;
|
|
} = props;
|
|
const ref = useRef();
|
|
const ref = useRef();
|
|
|
|
+ const permission = currentUser.Permission
|
|
|
|
|
|
const curItem = useMemo(() => {
|
|
const curItem = useMemo(() => {
|
|
let item = localStorage.getItem('currentAudit');
|
|
let item = localStorage.getItem('currentAudit');
|
|
return JSON.stringify(currentItem) == '{}' ? JSON.parse(item) : currentItem;
|
|
return JSON.stringify(currentItem) == '{}' ? JSON.parse(item) : currentItem;
|
|
}, [currentItem, localStorage.getItem('currentAudit')]);
|
|
}, [currentItem, localStorage.getItem('currentAudit')]);
|
|
|
|
|
|
|
|
+ const editMode = useMemo(() => {
|
|
|
|
+ // 判断是否有权限
|
|
|
|
+ if(permission['func-01-point-bom-flow']) {
|
|
|
|
+ return 1
|
|
|
|
+ }
|
|
|
|
+ // 判断是否为创建者
|
|
|
|
+ if(flowDetail.Creator == currentUser.ID) {
|
|
|
|
+ return 1
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return 2
|
|
|
|
+ },[permission,flowDetail])
|
|
|
|
+
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
dispatch({
|
|
dispatch({
|
|
type: 'flow/queryProcessFlows',
|
|
type: 'flow/queryProcessFlows',
|
|
@@ -46,6 +61,7 @@ function Audit(props) {
|
|
type: 'user/fetchDepV2',
|
|
type: 'user/fetchDepV2',
|
|
});
|
|
});
|
|
}, []);
|
|
}, []);
|
|
|
|
+
|
|
const onChange = values => {
|
|
const onChange = values => {
|
|
dispatch({
|
|
dispatch({
|
|
type: 'xflow/save',
|
|
type: 'xflow/save',
|
|
@@ -87,7 +103,7 @@ function Audit(props) {
|
|
<AuditForm value={formData} onChange={values => onChange(values)} />
|
|
<AuditForm value={formData} onChange={values => onChange(values)} />
|
|
</TabPane>
|
|
</TabPane>
|
|
<TabPane tab="流程控制" key="2">
|
|
<TabPane tab="流程控制" key="2">
|
|
- <Flow meta={{ type: 'edit', flowId: curItem.id }} flowDetail={flowDetail} ref={ref} />
|
|
|
|
|
|
+ <Flow meta={{ type: 'edit', editMode, flowId: curItem.id }} flowDetail={flowDetail} ref={ref} />
|
|
</TabPane>
|
|
</TabPane>
|
|
</Tabs>
|
|
</Tabs>
|
|
<Button
|
|
<Button
|
|
@@ -100,12 +116,13 @@ function Audit(props) {
|
|
</div>
|
|
</div>
|
|
);
|
|
);
|
|
}
|
|
}
|
|
-export default connect(({ flow, loading, xflow }) => ({
|
|
|
|
|
|
+export default connect(({ flow, loading, user, xflow }) => ({
|
|
roleList: flow.roleList,
|
|
roleList: flow.roleList,
|
|
currentItem: flow.current,
|
|
currentItem: flow.current,
|
|
loading: loading.models.purchaseList2,
|
|
loading: loading.models.purchaseList2,
|
|
formItems: xflow.formData,
|
|
formItems: xflow.formData,
|
|
flowDetail: flow.flowDetail,
|
|
flowDetail: flow.flowDetail,
|
|
formData: flow.formData,
|
|
formData: flow.formData,
|
|
|
|
+ currentUser: user.currentUser,
|
|
simpleFlowDteail: flow.simpleFlowDteail,
|
|
simpleFlowDteail: flow.simpleFlowDteail,
|
|
}))(Audit);
|
|
}))(Audit);
|