Commit cdbaedf8 authored by TZW's avatar TZW

11111

parent acd13dfd
...@@ -4,8 +4,16 @@ import { useModel } from '@umijs/max'; ...@@ -4,8 +4,16 @@ import { useModel } from '@umijs/max';
function PremButton(props) { function PremButton(props) {
const { initialState, setInitialState } = useModel('@@initialState'); const { initialState, setInitialState } = useModel('@@initialState');
console.log(initialState.newMenu);
let buttonPerm = initialState.newMenu.buttonPerm;
const { children, btn, pop, access } = props; const { children, btn, pop, access } = props;
let accesses = access ? ['havePrem'].includes(access) : true; console.log(access);
let res =
buttonPerm && buttonPerm.length > 0
? buttonPerm.filter((it) => it.typeName == access && it.show == 1)
: [];
console.log(res);
let accesses = access ? res.map((it) => it.typeName).includes(access) : true;
//配置按钮权限接口 //配置按钮权限接口
return pop ? ( return pop ? (
......
...@@ -31,7 +31,6 @@ const loginOut = async () => { ...@@ -31,7 +31,6 @@ const loginOut = async () => {
const AvatarDropdown = ({ menu }) => { const AvatarDropdown = ({ menu }) => {
const { initialState, setInitialState } = useModel('@@initialState'); const { initialState, setInitialState } = useModel('@@initialState');
console.log('initialState,', initialState);
const [visible, cv] = useState(false), const [visible, cv] = useState(false),
[formRef] = Form.useForm(), [formRef] = Form.useForm(),
{ run, loading } = useRequest(doFetch, { { run, loading } = useRequest(doFetch, {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2022-12-02 11:41:03 * @Date: 2022-12-02 11:41:03
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2022-12-30 17:32:29 * @Last Modified time: 2023-01-04 17:41:56
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -38,14 +38,7 @@ function Failure(props) { ...@@ -38,14 +38,7 @@ function Failure(props) {
} }
}, },
}); });
const perData = useRequest(async () => {
let res = await doFetch({
url: '/auth/sysPermission/queryButton',
params: { parentId: '400300' },
});
return res?.data?.dataList;
});
console.log(perData.data);
const detail = (text, row, _, action) => { const detail = (text, row, _, action) => {
return ( return (
<PremButton <PremButton
...@@ -113,52 +106,57 @@ function Failure(props) { ...@@ -113,52 +106,57 @@ function Failure(props) {
// 更多 // 更多
const More = (text, row, _, action) => { const More = (text, row, _, action) => {
console.log(perData.data);
const menu = ( const menu = (
<Menu <Menu
items={[ items={[
{ {
label: ( label: (
<a <PremButton
onClick={() => { access="umRepairOrder_dispatchById"
setdrawer((s) => ({ btn={{
...s, onClick: () => {
open: true, setdrawer((s) => ({
type: 'pd', ...s,
item: row, open: true,
val: 'only', type: 'pd',
title: row?.status == 8 ? '派单' : '接单', item: row,
})); val: 'only',
title: row?.status == 8 ? '派单' : '接单',
}));
},
}} }}
> >
{row?.status == 8 ? '派单' : '接单'} {row?.status == 8 ? '派单' : '接单'}
</a> </PremButton>
), ),
key: '0', key: '0',
}, },
{ {
label: ( label: (
<a <PremButton
onClick={() => { access="umRepairOrder_completeRepair"
setdrawer((s) => ({ btn={{
...s, onClick: () => {
open: true, setdrawer((s) => ({
type: 'wcwx', ...s,
item: row, open: true,
val: 'only', type: 'wcwx',
title: '完成维修', item: row,
})); val: 'only',
title: '完成维修',
}));
},
}} }}
> >
完成维修 完成维修
</a> </PremButton>
), ),
key: '1', key: '1',
}, },
{ {
label: ( label: (
<a <PremButton
access="umRepairOrder_transferTracking"
onClick={() => { onClick={() => {
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
...@@ -171,140 +169,161 @@ function Failure(props) { ...@@ -171,140 +169,161 @@ function Failure(props) {
}} }}
> >
转追踪 转追踪
</a> </PremButton>
), ),
key: '2', key: '2',
}, },
{ {
label: ( label: (
<a <PremButton
onClick={() => { access="umRepairOrder_transferOutsourcing"
setdrawer((s) => ({ btn={{
...s, onClick: () => {
open: true, setdrawer((s) => ({
type: 'zwx', ...s,
item: row, open: true,
val: 'only', type: 'zwx',
title: '转外协', item: row,
})); val: 'only',
title: '转外协',
}));
},
}} }}
> >
转外协 转外协
</a> </PremButton>
), ),
key: '3', key: '3',
}, },
{ {
label: ( label: (
<a <PremButton
onClick={() => { access="umRepairOrder_documentTransfer"
setdrawer((s) => ({ btn={{
...s, onClick: () => {
open: true, setdrawer((s) => ({
type: 'zd', ...s,
item: row, open: true,
val: 'only', type: 'zd',
title: '转单', item: row,
})); val: 'only',
title: '转单',
}));
},
}} }}
> >
转单 转单
</a> </PremButton>
), ),
key: '4', key: '4',
}, },
{ {
label: ( label: (
<a <PremButton
onClick={() => { access="umRepairOrder_chargeback"
setdrawer((s) => ({ btn={{
...s, onClick: () => {
open: true, setdrawer((s) => ({
type: 'td', ...s,
item: row, open: true,
val: 'only', type: 'td',
title: '退单', item: row,
})); val: 'only',
title: '退单',
}));
},
}} }}
> >
退单 退单
</a> </PremButton>
), ),
key: '5', key: '5',
}, },
{ {
label: ( label: (
<a <PremButton
onClick={() => { access="umRepairOrder_completeRepairValidate"
setdrawer((s) => ({ btn={{
...s, onClick: () => {
open: true, setdrawer((s) => ({
type: 'xgyz', ...s,
item: row, open: true,
val: 'only', type: 'xgyz',
title: '效果验证', item: row,
})); val: 'only',
title: '效果验证',
}));
},
}} }}
> >
效果验证 效果验证
</a> </PremButton>
), ),
key: '6', key: '6',
}, },
{ {
label: ( label: (
<a <PremButton
onClick={() => { access="umRepairOrder_transferTrackingAudit"
setdrawer((s) => ({ btn={{
...s, onClick: () => {
open: true, setdrawer((s) => ({
type: 'zzsh', ...s,
item: row, open: true,
val: 'only', type: 'zzsh',
title: '追踪审核', item: row,
})); val: 'only',
title: '追踪审核',
}));
},
}} }}
> >
追踪审核 追踪审核
</a> </PremButton>
), ),
key: '7', key: '7',
}, },
{ {
label: ( label: (
<a <PremButton
onClick={() => { access="umRepairOrder_transferAudit"
setdrawer((s) => ({ btn={{
...s, onClick: () => {
open: true, setdrawer((s) => ({
type: 'wxsh', ...s,
item: row, open: true,
val: 'only', type: 'wxsh',
title: '外协审核', item: row,
})); val: 'only',
title: '外协审核',
}));
},
}} }}
> >
外协审核 外协审核
</a> </PremButton>
), ),
key: '8', key: '8',
}, },
{ {
label: ( label: (
<a <PremButton
onClick={() => { access="umRepairOrder_chargebackAudit"
setdrawer((s) => ({ btn={{
...s, onClick: () => {
open: true, setdrawer((s) => ({
type: 'tdsh', ...s,
item: row, open: true,
val: 'only', type: 'tdsh',
title: '退单审核', item: row,
})); val: 'only',
title: '退单审核',
}));
},
}} }}
> >
退单审核 退单审核
</a> </PremButton>
), ),
key: '9', key: '9',
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2022-12-02 11:41:03 * @Date: 2022-12-02 11:41:03
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2023-01-04 10:31:19 * @Last Modified time: 2023-01-04 17:46:11
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -251,64 +251,70 @@ function Failure(props) { ...@@ -251,64 +251,70 @@ function Failure(props) {
{ {
label: label:
row?.status == 0 || row?.status == 1 ? ( row?.status == 0 || row?.status == 1 ? (
<a <PremButton
onClick={async () => { btn={{
let params = { onClick: async () => {
id: row?.id, let params = {
}; id: row?.id,
let res = await doFetch({ };
url: '/repair/umOtherUnitsOrder/orderReceiving', let res = await doFetch({
params, url: '/repair/umOtherUnitsOrder/orderReceiving',
}); params,
if (res.code === '0000') { });
message.success('接单成功!'); if (res.code === '0000') {
setdrawer((s) => ({ message.success('接单成功!');
...s, setdrawer((s) => ({
open: false, ...s,
})); open: false,
actionRef.current.reload(); }));
} actionRef.current.reload();
}
},
}} }}
> >
接单 接单
</a> </PremButton>
) : ( ) : (
<a <PremButton
onClick={async () => { btn={{
setdrawer((s) => ({ onClick: async () => {
...s, setdrawer((s) => ({
open: true, ...s,
type: 'wxpd', open: true,
item: row, type: 'wxpd',
val: 'only', item: row,
title: '派单', val: 'only',
})); title: '派单',
}));
},
}} }}
> >
派单 派单
</a> </PremButton>
), ),
key: '0', key: '0',
// disabled: true, // disabled: true,
}, },
{ {
label: ( label: (
<a <PremButton
onClick={() => { btn={{
setdrawer((s) => ({ onClick: () => {
...s, setdrawer((s) => ({
open: true, ...s,
type: 'comouts', open: true,
item: { type: 'comouts',
id: row.id, item: {
}, id: row.id,
val: 'only', },
title: '完成外协', val: 'only',
})); title: '完成外协',
}));
},
}} }}
> >
完成外协 完成外协
</a> </PremButton>
), ),
key: '1', key: '1',
}, },
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2022-12-02 11:41:03 * @Date: 2022-12-02 11:41:03
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2023-01-04 10:30:44 * @Last Modified time: 2023-01-04 16:25:39
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -322,7 +322,7 @@ function Failure(props) { ...@@ -322,7 +322,7 @@ function Failure(props) {
{ {
label: label:
row?.status == 0 || row?.status == 1 ? ( row?.status == 0 || row?.status == 1 ? (
<a <PremButton
onClick={async () => { onClick={async () => {
let params = { let params = {
id: row?.id, id: row?.id,
...@@ -342,9 +342,9 @@ function Failure(props) { ...@@ -342,9 +342,9 @@ function Failure(props) {
}} }}
> >
接单 接单
</a> </PremButton>
) : ( ) : (
<a <PremButton
onClick={async () => { onClick={async () => {
let params = { let params = {
id: row?.id, id: row?.id,
...@@ -364,14 +364,14 @@ function Failure(props) { ...@@ -364,14 +364,14 @@ function Failure(props) {
}} }}
> >
派单 派单
</a> </PremButton>
), ),
key: '0', key: '0',
// disabled: true, // disabled: true,
}, },
{ {
label: ( label: (
<a <PremButton
onClick={() => { onClick={() => {
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
...@@ -386,13 +386,13 @@ function Failure(props) { ...@@ -386,13 +386,13 @@ function Failure(props) {
}} }}
> >
追踪 追踪
</a> </PremButton>
), ),
key: '1', key: '1',
}, },
{ {
label: ( label: (
<a <PremButton
onClick={() => { onClick={() => {
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
...@@ -407,7 +407,7 @@ function Failure(props) { ...@@ -407,7 +407,7 @@ function Failure(props) {
}} }}
> >
验证 验证
</a> </PremButton>
), ),
key: '2', key: '2',
}, },
......
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