Commit cdbaedf8 authored by TZW's avatar TZW

11111

parent acd13dfd
......@@ -4,8 +4,16 @@ import { useModel } from '@umijs/max';
function PremButton(props) {
const { initialState, setInitialState } = useModel('@@initialState');
console.log(initialState.newMenu);
let buttonPerm = initialState.newMenu.buttonPerm;
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 ? (
......
......@@ -31,7 +31,6 @@ const loginOut = async () => {
const AvatarDropdown = ({ menu }) => {
const { initialState, setInitialState } = useModel('@@initialState');
console.log('initialState,', initialState);
const [visible, cv] = useState(false),
[formRef] = Form.useForm(),
{ run, loading } = useRequest(doFetch, {
......
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-12-02 11:41:03
* @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';
......@@ -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) => {
return (
<PremButton
......@@ -113,52 +106,57 @@ function Failure(props) {
// 更多
const More = (text, row, _, action) => {
console.log(perData.data);
const menu = (
<Menu
items={[
{
label: (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
type: 'pd',
item: row,
val: 'only',
title: row?.status == 8 ? '派单' : '接单',
}));
<PremButton
access="umRepairOrder_dispatchById"
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
type: 'pd',
item: row,
val: 'only',
title: row?.status == 8 ? '派单' : '接单',
}));
},
}}
>
{row?.status == 8 ? '派单' : '接单'}
</a>
</PremButton>
),
key: '0',
},
{
label: (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
type: 'wcwx',
item: row,
val: 'only',
title: '完成维修',
}));
<PremButton
access="umRepairOrder_completeRepair"
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
type: 'wcwx',
item: row,
val: 'only',
title: '完成维修',
}));
},
}}
>
完成维修
</a>
</PremButton>
),
key: '1',
},
{
label: (
<a
<PremButton
access="umRepairOrder_transferTracking"
onClick={() => {
setdrawer((s) => ({
...s,
......@@ -171,140 +169,161 @@ function Failure(props) {
}}
>
转追踪
</a>
</PremButton>
),
key: '2',
},
{
label: (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
type: 'zwx',
item: row,
val: 'only',
title: '转外协',
}));
<PremButton
access="umRepairOrder_transferOutsourcing"
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
type: 'zwx',
item: row,
val: 'only',
title: '转外协',
}));
},
}}
>
转外协
</a>
</PremButton>
),
key: '3',
},
{
label: (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
type: 'zd',
item: row,
val: 'only',
title: '转单',
}));
<PremButton
access="umRepairOrder_documentTransfer"
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
type: 'zd',
item: row,
val: 'only',
title: '转单',
}));
},
}}
>
转单
</a>
</PremButton>
),
key: '4',
},
{
label: (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
type: 'td',
item: row,
val: 'only',
title: '退单',
}));
<PremButton
access="umRepairOrder_chargeback"
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
type: 'td',
item: row,
val: 'only',
title: '退单',
}));
},
}}
>
退单
</a>
</PremButton>
),
key: '5',
},
{
label: (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
type: 'xgyz',
item: row,
val: 'only',
title: '效果验证',
}));
<PremButton
access="umRepairOrder_completeRepairValidate"
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
type: 'xgyz',
item: row,
val: 'only',
title: '效果验证',
}));
},
}}
>
效果验证
</a>
</PremButton>
),
key: '6',
},
{
label: (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
type: 'zzsh',
item: row,
val: 'only',
title: '追踪审核',
}));
<PremButton
access="umRepairOrder_transferTrackingAudit"
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
type: 'zzsh',
item: row,
val: 'only',
title: '追踪审核',
}));
},
}}
>
追踪审核
</a>
</PremButton>
),
key: '7',
},
{
label: (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
type: 'wxsh',
item: row,
val: 'only',
title: '外协审核',
}));
<PremButton
access="umRepairOrder_transferAudit"
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
type: 'wxsh',
item: row,
val: 'only',
title: '外协审核',
}));
},
}}
>
外协审核
</a>
</PremButton>
),
key: '8',
},
{
label: (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
type: 'tdsh',
item: row,
val: 'only',
title: '退单审核',
}));
<PremButton
access="umRepairOrder_chargebackAudit"
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
type: 'tdsh',
item: row,
val: 'only',
title: '退单审核',
}));
},
}}
>
退单审核
</a>
</PremButton>
),
key: '9',
},
......
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-12-02 11:41:03
* @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';
......@@ -251,64 +251,70 @@ function Failure(props) {
{
label:
row?.status == 0 || row?.status == 1 ? (
<a
onClick={async () => {
let params = {
id: row?.id,
};
let res = await doFetch({
url: '/repair/umOtherUnitsOrder/orderReceiving',
params,
});
if (res.code === '0000') {
message.success('接单成功!');
setdrawer((s) => ({
...s,
open: false,
}));
actionRef.current.reload();
}
<PremButton
btn={{
onClick: async () => {
let params = {
id: row?.id,
};
let res = await doFetch({
url: '/repair/umOtherUnitsOrder/orderReceiving',
params,
});
if (res.code === '0000') {
message.success('接单成功!');
setdrawer((s) => ({
...s,
open: false,
}));
actionRef.current.reload();
}
},
}}
>
接单
</a>
</PremButton>
) : (
<a
onClick={async () => {
setdrawer((s) => ({
...s,
open: true,
type: 'wxpd',
item: row,
val: 'only',
title: '派单',
}));
<PremButton
btn={{
onClick: async () => {
setdrawer((s) => ({
...s,
open: true,
type: 'wxpd',
item: row,
val: 'only',
title: '派单',
}));
},
}}
>
派单
</a>
</PremButton>
),
key: '0',
// disabled: true,
},
{
label: (
<a
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
type: 'comouts',
item: {
id: row.id,
},
val: 'only',
title: '完成外协',
}));
<PremButton
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
type: 'comouts',
item: {
id: row.id,
},
val: 'only',
title: '完成外协',
}));
},
}}
>
完成外协
</a>
</PremButton>
),
key: '1',
},
......
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-12-02 11:41:03
* @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';
......@@ -322,7 +322,7 @@ function Failure(props) {
{
label:
row?.status == 0 || row?.status == 1 ? (
<a
<PremButton
onClick={async () => {
let params = {
id: row?.id,
......@@ -342,9 +342,9 @@ function Failure(props) {
}}
>
接单
</a>
</PremButton>
) : (
<a
<PremButton
onClick={async () => {
let params = {
id: row?.id,
......@@ -364,14 +364,14 @@ function Failure(props) {
}}
>
派单
</a>
</PremButton>
),
key: '0',
// disabled: true,
},
{
label: (
<a
<PremButton
onClick={() => {
setdrawer((s) => ({
...s,
......@@ -386,13 +386,13 @@ function Failure(props) {
}}
>
追踪
</a>
</PremButton>
),
key: '1',
},
{
label: (
<a
<PremButton
onClick={() => {
setdrawer((s) => ({
...s,
......@@ -407,7 +407,7 @@ function Failure(props) {
}}
>
验证
</a>
</PremButton>
),
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