Commit b894cdf5 authored by TZW's avatar TZW

bug 维修模块

parent 3a7ac0aa
function getcolumns(setdrawer) { function getcolumns(setdrawer, bus) {
let listOptions = [];
if (bus !== "2") {
// 0:报修 1:接单 2:派单 3:完成维修 4:转追踪 5:转外协 6:转单 7:退单 8:追踪审核 9:外协审核 10:退单审核 11:效果验证
listOptions = [
{
label: '待接单',
value: '0',
},
{
label: '待接单(转单)',
value: '1',
},
{
label: '维修中',
value: '2',
},
{
label: '待验证(完成维修)',
value: '3',
},
{
label: '待审核(转外协)',
value: '4',
},
{
label: '外协中',
value: '5',
},
{
label: '待审核(转追踪)',
value: '6',
},
{
label: '待审核(退单)',
value: '7',
},
];
} else {
listOptions = [
{
label: '待派单',
value: '8',
},
{
label: '待派单(转单)',
value: '9',
},
{
label: '维修中',
value: '2',
},
{
label: '待验证(完成维修)',
value: '3',
},
{
label: '待审核(转外协)',
value: '4',
},
{
label: '外协中',
value: '5',
},
{
label: '待审核(转追踪)',
value: '6',
},
{
label: '待审核(退单)',
value: '7',
},
];
}
return [ return [
{ {
tab: '我的待办', tab: '我的待办',
...@@ -89,17 +163,11 @@ function getcolumns(setdrawer) { ...@@ -89,17 +163,11 @@ function getcolumns(setdrawer) {
title: '工单状态', title: '工单状态',
dataIndex: 'statusName', dataIndex: 'statusName',
key: 'status', key: 'status',
valueType: 'radio', valueType: 'select',
options: [ options: listOptions,
{ fieldProps: {
label: '待维修', dropdownMatchSelectWidth: 150,
value: '1', },
},
{
label: '维修中',
value: '2',
},
],
}, },
], ],
pathconfig: { pathconfig: {
...@@ -203,17 +271,11 @@ function getcolumns(setdrawer) { ...@@ -203,17 +271,11 @@ function getcolumns(setdrawer) {
title: '工单状态', title: '工单状态',
dataIndex: 'statusName', dataIndex: 'statusName',
key: 'status', key: 'status',
valueType: 'radio', valueType: 'select',
options: [ options: listOptions,
{ fieldProps: {
label: '待维修', dropdownMatchSelectWidth: 150,
value: '1', },
},
{
label: '维修中',
value: '2',
},
],
}, },
], ],
pathconfig: { pathconfig: {
...@@ -329,17 +391,11 @@ function getcolumns(setdrawer) { ...@@ -329,17 +391,11 @@ function getcolumns(setdrawer) {
title: '工单状态', title: '工单状态',
dataIndex: 'statusName', dataIndex: 'statusName',
key: 'status', key: 'status',
valueType: 'radio', valueType: 'select',
options: [ options: listOptions,
{ fieldProps: {
label: '待维修', dropdownMatchSelectWidth: 150,
value: '1', },
},
{
label: '维修中',
value: '2',
},
],
}, },
], ],
pathconfig: { pathconfig: {
......
/* eslint-disable react-hooks/exhaustive-deps */
/* 维修工单 /* 维修工单
* @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 17:41:56 * @Last Modified time: 2023-01-29 15:38:13
*/ */
import * as React from 'react'; import * as React from 'react';
...@@ -22,10 +23,24 @@ function Failure(props) { ...@@ -22,10 +23,24 @@ function Failure(props) {
const actionRef = useRef(), const actionRef = useRef(),
formRef = useRef(); formRef = useRef();
const [drawer, setdrawer] = useState({ const [drawer, setdrawer] = useState({
open: false, open: false,
}), SpecName: null,
}),
[activeTabKey, setactiveTabKey] = useState('1'); [activeTabKey, setactiveTabKey] = useState('1');
useEffect(async () => {
let res = await doFetch({
url: '/base/pmBaseBusinessData/queryBySpecName',
params: {
businessSpecName: 'ORDER_RECEIVING_DISTRIBUTE',
},
});
setdrawer((s) => ({
...s,
SpecName: res?.data?.data,
}));
}, []);
const { run, loading } = useRequest(doFetch, { const { run, loading } = useRequest(doFetch, {
manual: true, manual: true,
onSuccess: (res, params) => { onSuccess: (res, params) => {
...@@ -106,230 +121,456 @@ function Failure(props) { ...@@ -106,230 +121,456 @@ function Failure(props) {
// 更多 // 更多
const More = (text, row, _, action) => { const More = (text, row, _, action) => {
const menu = ( console.log(drawer);
<Menu let menulist = [];
items={[ if (drawer?.SpecName?.businessData !== '2') {
{ // 接单模式
label: ( console.log(1);
<PremButton menulist = [
access="umRepairOrder_dispatchById" {
btn={{ label: (
onClick: () => { <PremButton
setdrawer((s) => ({ access="umRepairOrder_dispatchById"
...s, btn={{
open: true, onClick: () => {
type: 'pd',
item: row,
val: 'only',
title: row?.status == 8 ? '派单' : '接单',
}));
},
}}
>
{row?.status == 8 ? '派单' : '接单'}
</PremButton>
),
key: '0',
},
{
label: (
<PremButton
access="umRepairOrder_completeRepair"
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
type: 'wcwx',
item: row,
val: 'only',
title: '完成维修',
}));
},
}}
>
完成维修
</PremButton>
),
key: '1',
},
{
label: (
<PremButton
access="umRepairOrder_transferTracking"
onClick={() => {
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
open: true, open: true,
type: 'zzz', type: 'jd',
item: row, item: row,
val: 'only', val: 'only',
title: '转追踪', title: '接单',
})); }));
}} },
> }}
转追踪 >
</PremButton> 接单
), </PremButton>
key: '2', ),
}, key: '0',
{ },
label: ( {
<PremButton label: (
access="umRepairOrder_transferOutsourcing" <PremButton
btn={{ access="umRepairOrder_completeRepair"
onClick: () => { btn={{
setdrawer((s) => ({ onClick: () => {
...s, setdrawer((s) => ({
open: true, ...s,
type: 'zwx', open: true,
item: row, type: 'wcwx',
val: 'only', item: row,
title: '转外协', val: 'only',
})); title: '完成维修',
}, }));
}} },
> }}
转外协 >
</PremButton> 完成维修
), </PremButton>
key: '3', ),
}, key: '1',
{ },
label: ( {
<PremButton label: (
access="umRepairOrder_documentTransfer" <PremButton
btn={{ access="umRepairOrder_transferTracking"
onClick: () => { onClick={() => {
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
open: true, open: true,
type: 'zd', type: 'zzz',
item: row, item: row,
val: 'only', val: 'only',
title: '转单', title: '转追踪',
})); }));
}, }}
}} >
> 转追踪
转单 </PremButton>
</PremButton> ),
), key: '2',
key: '4', },
}, {
{ label: (
label: ( <PremButton
<PremButton access="umRepairOrder_transferOutsourcing"
access="umRepairOrder_chargeback" btn={{
btn={{ onClick: () => {
onClick: () => { setdrawer((s) => ({
setdrawer((s) => ({ ...s,
...s, open: true,
open: true, type: 'zwx',
type: 'td', item: row,
item: row, val: 'only',
val: 'only', title: '转外协',
title: '退单', }));
})); },
}, }}
}} >
> 转外协
退单 </PremButton>
</PremButton> ),
), key: '3',
key: '5', },
}, {
{ label: (
label: ( <PremButton
<PremButton access="umRepairOrder_documentTransfer"
access="umRepairOrder_completeRepairValidate" btn={{
btn={{ onClick: () => {
onClick: () => { setdrawer((s) => ({
setdrawer((s) => ({ ...s,
...s, open: true,
open: true, type: 'zd',
type: 'xgyz', item: row,
item: row, val: 'only',
val: 'only', title: '转单',
title: '效果验证', }));
})); },
}, }}
}} >
> 转单
效果验证 </PremButton>
</PremButton> ),
), key: '4',
key: '6', },
}, {
{ label: (
label: ( <PremButton
<PremButton access="umRepairOrder_chargeback"
access="umRepairOrder_transferTrackingAudit" btn={{
btn={{ onClick: () => {
onClick: () => { setdrawer((s) => ({
setdrawer((s) => ({ ...s,
...s, open: true,
open: true, type: 'td',
type: 'zzsh', item: row,
item: row, val: 'only',
val: 'only', title: '退单',
title: '追踪审核', }));
})); },
}, }}
}} >
> 退单
追踪审核 </PremButton>
</PremButton> ),
), key: '5',
key: '7', },
}, {
{ label: (
label: ( <PremButton
<PremButton access="umRepairOrder_completeRepairValidate"
access="umRepairOrder_transferAudit" btn={{
btn={{ onClick: () => {
onClick: () => { setdrawer((s) => ({
setdrawer((s) => ({ ...s,
...s, open: true,
open: true, type: 'xgyz',
type: 'wxsh', item: row,
item: row, val: 'only',
val: 'only', title: '效果验证',
title: '外协审核', }));
})); },
}, }}
}} >
> 效果验证
外协审核 </PremButton>
</PremButton> ),
), key: '6',
key: '8', },
}, {
{ label: (
label: ( <PremButton
<PremButton access="umRepairOrder_transferTrackingAudit"
access="umRepairOrder_chargebackAudit" btn={{
btn={{ onClick: () => {
onClick: () => { setdrawer((s) => ({
setdrawer((s) => ({ ...s,
...s, open: true,
open: true, type: 'zzsh',
type: 'tdsh', item: row,
item: row, val: 'only',
val: 'only', title: '追踪审核',
title: '退单审核', }));
})); },
}, }}
}} >
> 追踪审核
退单审核 </PremButton>
</PremButton> ),
), key: '7',
key: '9', },
}, {
]} label: (
/> <PremButton
); access="umRepairOrder_transferAudit"
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
type: 'wxsh',
item: row,
val: 'only',
title: '外协审核',
}));
},
}}
>
外协审核
</PremButton>
),
key: '8',
},
{
label: (
<PremButton
access="umRepairOrder_chargebackAudit"
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
type: 'tdsh',
item: row,
val: 'only',
title: '退单审核',
}));
},
}}
>
退单审核
</PremButton>
),
key: '9',
},
];
} else {
console.log(2);
menulist = [
{
label: (
<PremButton
access="umRepairOrder_dispatchById"
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
type: 'pd',
item: row,
val: 'only',
title: '派单',
}));
},
}}
>
派单
</PremButton>
),
key: '0',
},
{
label: (
<PremButton
access="umRepairOrder_completeRepair"
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
type: 'wcwx',
item: row,
val: 'only',
title: '完成维修',
}));
},
}}
>
完成维修
</PremButton>
),
key: '1',
},
{
label: (
<PremButton
access="umRepairOrder_transferTracking"
onClick={() => {
setdrawer((s) => ({
...s,
open: true,
type: 'zzz',
item: row,
val: 'only',
title: '转追踪',
}));
}}
>
转追踪
</PremButton>
),
key: '2',
},
{
label: (
<PremButton
access="umRepairOrder_transferOutsourcing"
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
type: 'zwx',
item: row,
val: 'only',
title: '转外协',
}));
},
}}
>
转外协
</PremButton>
),
key: '3',
},
{
label: (
<PremButton
access="umRepairOrder_documentTransfer"
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
type: 'zd',
item: row,
val: 'only',
title: '转单',
}));
},
}}
>
转单
</PremButton>
),
key: '4',
},
{
label: (
<PremButton
access="umRepairOrder_chargeback"
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
type: 'td',
item: row,
val: 'only',
title: '退单',
}));
},
}}
>
退单
</PremButton>
),
key: '5',
},
{
label: (
<PremButton
access="umRepairOrder_completeRepairValidate"
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
type: 'xgyz',
item: row,
val: 'only',
title: '效果验证',
}));
},
}}
>
效果验证
</PremButton>
),
key: '6',
},
{
label: (
<PremButton
access="umRepairOrder_transferTrackingAudit"
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
type: 'zzsh',
item: row,
val: 'only',
title: '追踪审核',
}));
},
}}
>
追踪审核
</PremButton>
),
key: '7',
},
{
label: (
<PremButton
access="umRepairOrder_transferAudit"
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
type: 'wxsh',
item: row,
val: 'only',
title: '外协审核',
}));
},
}}
>
外协审核
</PremButton>
),
key: '8',
},
{
label: (
<PremButton
access="umRepairOrder_chargebackAudit"
btn={{
onClick: () => {
setdrawer((s) => ({
...s,
open: true,
type: 'tdsh',
item: row,
val: 'only',
title: '退单审核',
}));
},
}}
>
退单审核
</PremButton>
),
key: '9',
},
];
}
const menu = <Menu items={menulist} />;
return ( return (
<Dropdown <Dropdown
overlay={menu} overlay={menu}
...@@ -1151,8 +1392,13 @@ function Failure(props) { ...@@ -1151,8 +1392,13 @@ function Failure(props) {
}; };
const columns = useMemo(() => { const columns = useMemo(() => {
let defcolumn = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.columns; let defcolumn = getcolumns(setdrawer, drawer?.SpecName?.businessData).filter(
let defpath = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {}; (it) => it.key == activeTabKey,
)[0]?.columns;
let defpath =
getcolumns(setdrawer, drawer?.SpecName?.businessData).filter(
(it) => it.key == activeTabKey,
)[0]?.pathconfig ?? {};
if (activeTabKey == 1) { if (activeTabKey == 1) {
return defcolumn.concat({ return defcolumn.concat({
title: '操作', title: '操作',
...@@ -1163,7 +1409,7 @@ function Failure(props) { ...@@ -1163,7 +1409,7 @@ function Failure(props) {
} else { } else {
return defcolumn; return defcolumn;
} }
}, [activeTabKey]); }, [activeTabKey, drawer]);
const pathconfig = useMemo(() => { const pathconfig = useMemo(() => {
let defpath = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {}; let defpath = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {};
......
function getcolumns(setdrawer) { function getcolumns(setdrawer, bus) {
let listOptions = [];
if (bus !== '2') {
listOptions = [
{
label: '待接单',
value: '1',
},
{
label: '外协中',
value: '3',
},
{
label: '已完成',
value: '4',
},
];
} else {
listOptions = [
{
label: '待派单',
value: '2',
},
{
label: '外协中',
value: '3',
},
{
label: '已完成',
value: '4',
},
];
}
return [ return [
{ {
tab: '我的待办', tab: '我的待办',
...@@ -48,7 +80,8 @@ function getcolumns(setdrawer) { ...@@ -48,7 +80,8 @@ function getcolumns(setdrawer) {
title: '创建时间', title: '创建时间',
dataIndex: 'createTime', dataIndex: 'createTime',
key: 'createTimeList', key: 'createTimeList',
valueType: 'dateTimeRange', fieldProps: { valueType: 'dateTimeRange',
fieldProps: {
showTime: { showTime: {
format: 'HH:mm', format: 'HH:mm',
}, },
...@@ -88,17 +121,11 @@ function getcolumns(setdrawer) { ...@@ -88,17 +121,11 @@ function getcolumns(setdrawer) {
title: '工单状态', title: '工单状态',
dataIndex: 'statusName', dataIndex: 'statusName',
key: 'status', key: 'status',
valueType: 'radio', valueType: 'select',
options: [ options: listOptions,
{ fieldProps: {
label: '待维修', dropdownMatchSelectWidth: 150,
value: '1', },
},
{
label: '维修中',
value: '2',
},
],
}, },
], ],
pathconfig: { pathconfig: {
...@@ -161,7 +188,8 @@ function getcolumns(setdrawer) { ...@@ -161,7 +188,8 @@ function getcolumns(setdrawer) {
title: '创建时间', title: '创建时间',
dataIndex: 'createTime', dataIndex: 'createTime',
key: 'createTimeList', key: 'createTimeList',
valueType: 'dateTimeRange', fieldProps: { valueType: 'dateTimeRange',
fieldProps: {
showTime: { showTime: {
format: 'HH:mm', format: 'HH:mm',
}, },
...@@ -201,17 +229,11 @@ function getcolumns(setdrawer) { ...@@ -201,17 +229,11 @@ function getcolumns(setdrawer) {
title: '工单状态', title: '工单状态',
dataIndex: 'statusName', dataIndex: 'statusName',
key: 'status', key: 'status',
valueType: 'radio', valueType: 'select',
options: [ options: listOptions,
{ fieldProps: {
label: '待维修', dropdownMatchSelectWidth: 150,
value: '1', },
},
{
label: '维修中',
value: '2',
},
],
}, },
], ],
pathconfig: { pathconfig: {
...@@ -274,7 +296,8 @@ function getcolumns(setdrawer) { ...@@ -274,7 +296,8 @@ function getcolumns(setdrawer) {
title: '创建时间', title: '创建时间',
dataIndex: 'createTime', dataIndex: 'createTime',
key: 'createTimeList', key: 'createTimeList',
valueType: 'dateTimeRange', fieldProps: { valueType: 'dateTimeRange',
fieldProps: {
showTime: { showTime: {
format: 'HH:mm', format: 'HH:mm',
}, },
...@@ -314,17 +337,11 @@ function getcolumns(setdrawer) { ...@@ -314,17 +337,11 @@ function getcolumns(setdrawer) {
title: '工单状态', title: '工单状态',
dataIndex: 'statusName', dataIndex: 'statusName',
key: 'status', key: 'status',
valueType: 'radio', valueType: 'select',
options: [ options: listOptions,
{ fieldProps: {
label: '待维修', dropdownMatchSelectWidth: 150,
value: '1', },
},
{
label: '维修中',
value: '2',
},
],
}, },
], ],
pathconfig: { pathconfig: {
......
/* eslint-disable react-hooks/exhaustive-deps */
/* 外协工单 /* 外协工单
* @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-18 17:46:04 * @Last Modified time: 2023-01-29 16:49:15
*/ */
import * as React from 'react'; import * as React from 'react';
import { useState, useMemo, useRef } from 'react'; import { useState, useMemo, useRef, useEffect } from 'react';
import DrawerPro from '@/components/DrawerPro'; import DrawerPro from '@/components/DrawerPro';
import AutoTable from '@/components/AutoTable'; import AutoTable from '@/components/AutoTable';
import PremButton from '@/components/PremButton'; import PremButton from '@/components/PremButton';
...@@ -24,6 +25,7 @@ function Failure(props) { ...@@ -24,6 +25,7 @@ function Failure(props) {
formRef = useRef(); formRef = useRef();
const [drawer, setdrawer] = useState({ const [drawer, setdrawer] = useState({
open: false, open: false,
SpecName: null,
}), }),
[activeTabKey, setactiveTabKey] = useState('1'); [activeTabKey, setactiveTabKey] = useState('1');
...@@ -40,6 +42,17 @@ function Failure(props) { ...@@ -40,6 +42,17 @@ function Failure(props) {
}, },
}); });
useEffect(async () => {
let res = await doFetch({
url: '/base/pmBaseBusinessData/queryBySpecName',
params: { businessSpecName: 'TRANSFER_ORDER_DISTRIBUTE' },
});
setdrawer((s) => ({
...s,
SpecName: res?.data?.data,
}));
}, []);
const detail = (text, row, _, action) => { const detail = (text, row, _, action) => {
return ( return (
<PremButton <PremButton
...@@ -379,9 +392,14 @@ function Failure(props) { ...@@ -379,9 +392,14 @@ function Failure(props) {
}; };
const columns = useMemo(() => { const columns = useMemo(() => {
let defcolumn = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.columns; let defcolumn = getcolumns(setdrawer, drawer?.SpecName?.businessData).filter(
(it) => it.key == activeTabKey,
)[0]?.columns;
//console.log(defcolumn); //console.log(defcolumn);
let defpath = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {}; let defpath =
getcolumns(setdrawer, drawer?.SpecName?.businessData).filter(
(it) => it.key == activeTabKey,
)[0]?.pathconfig ?? {};
if (activeTabKey == '1') { if (activeTabKey == '1') {
return defcolumn.concat({ return defcolumn.concat({
......
function getcolumns(setdrawer) { function getcolumns(setdrawer, bus) {
let listOptions = [];
if (bus !== '2') {
listOptions = [
{
label: '待接单',
value: '0',
},
{
label: '待接单(转单)',
value: '1',
},
];
} else {
listOptions = [
{
label: '待派单',
value: '8',
},
{
label: '待派单(转单)',
value: '9',
},
];
}
return [ return [
{ {
tab: '维修工单', tab: '维修工单',
...@@ -76,6 +100,11 @@ function getcolumns(setdrawer) { ...@@ -76,6 +100,11 @@ function getcolumns(setdrawer) {
title: '工单状态', title: '工单状态',
dataIndex: 'statusName', dataIndex: 'statusName',
key: 'statusName', key: 'statusName',
valueType: 'select',
options: listOptions,
fieldProps: {
dropdownMatchSelectWidth: 150,
},
}, },
], ],
pathconfig: { pathconfig: {
...@@ -166,6 +195,11 @@ function getcolumns(setdrawer) { ...@@ -166,6 +195,11 @@ function getcolumns(setdrawer) {
title: '工单状态', title: '工单状态',
dataIndex: 'statusName', dataIndex: 'statusName',
key: 'statusName', key: 'statusName',
valueType: 'select',
options: listOptions,
fieldProps: {
dropdownMatchSelectWidth: 150,
},
}, },
], ],
pathconfig: { pathconfig: {
...@@ -256,6 +290,11 @@ function getcolumns(setdrawer) { ...@@ -256,6 +290,11 @@ function getcolumns(setdrawer) {
title: '工单状态', title: '工单状态',
dataIndex: 'statusName', dataIndex: 'statusName',
key: 'statusName', key: 'statusName',
valueType: 'select',
options: listOptions,
fieldProps: {
dropdownMatchSelectWidth: 150,
},
}, },
], ],
pathconfig: { pathconfig: {
......
/* eslint-disable react-hooks/exhaustive-deps */
/* 接单平台 /* 接单平台
* @Author: Li Hanlin * @Author: Li Hanlin
* @Date: 2022-12-05 10:13:42 * @Date: 2022-12-05 10:13:42
* @Last Modified by: Li Hanlin * @Last Modified by: Li Hanlin
* @Last Modified time: 2023-01-29 09:21:45 * @Last Modified time: 2023-01-29 16:25:57
*/ */
import * as React from 'react'; import * as React from 'react';
import { useState, useMemo, useRef } from 'react'; import { useState, useMemo, useRef, useEffect } from 'react';
import DrawerPro from '@/components/DrawerPro'; import DrawerPro from '@/components/DrawerPro';
import AutoTable from '@/components/AutoTable'; import AutoTable from '@/components/AutoTable';
import PremButton from '@/components/PremButton'; import PremButton from '@/components/PremButton';
...@@ -21,6 +22,7 @@ function Platform(props) { ...@@ -21,6 +22,7 @@ function Platform(props) {
formRef = useRef(); formRef = useRef();
const [drawer, setdrawer] = useState({ const [drawer, setdrawer] = useState({
open: false, open: false,
SpecName: null,
}), }),
[activeTabKey, setactiveTabKey] = useState('1'); [activeTabKey, setactiveTabKey] = useState('1');
...@@ -37,6 +39,25 @@ function Platform(props) { ...@@ -37,6 +39,25 @@ function Platform(props) {
}, },
}); });
useEffect(async () => {
let params = {};
if (activeTabKey == '1') {
params.businessSpecName = 'ORDER_RECEIVING_DISTRIBUTE';
} else if (activeTabKey == '2') {
params.businessSpecName = 'TRACKING_ORDER_DISTRIBUTE';
} else if (activeTabKey == '3') {
params.businessSpecName = 'TRANSFER_ORDER_DISTRIBUTE';
}
let res = await doFetch({
url: '/base/pmBaseBusinessData/queryBySpecName',
params,
});
setdrawer((s) => ({
...s,
SpecName: res?.data?.data,
}));
}, [activeTabKey]);
const detail = (text, row, _, action) => { const detail = (text, row, _, action) => {
return ( return (
<PremButton <PremButton
...@@ -219,8 +240,13 @@ function Platform(props) { ...@@ -219,8 +240,13 @@ function Platform(props) {
}; };
const columns = useMemo(() => { const columns = useMemo(() => {
let defcolumn = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.columns; let defcolumn = getcolumns(setdrawer, drawer?.SpecName?.businessData).filter(
let defpath = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {}; (it) => it.key == activeTabKey,
)[0]?.columns;
let defpath =
getcolumns(setdrawer, drawer?.SpecName?.businessData).filter(
(it) => it.key == activeTabKey,
)[0]?.pathconfig ?? {};
let actions = { let actions = {
title: '操作', title: '操作',
valueType: 'option', valueType: 'option',
......
function getcolumns(setdrawer) { import dayjs from 'dayjs';
console.log(dayjs().format('YYYY-MM-DD').valueOf());
function getcolumns(setdrawer, bus) {
let listOptions = [];
if (bus !== '2') {
listOptions = [
{
label: '待接单',
value: '1',
},
{
label: '追踪中',
value: '3',
},
{
label: '待验证',
value: '4',
},
{
label: '已完成',
value: '5',
},
];
} else {
listOptions = [
{
label: '待派单',
value: '2',
},
{
label: '追踪中',
value: '3',
},
{
label: '待验证',
value: '4',
},
{
label: '已完成',
value: '5',
},
];
}
return [ return [
{ {
tab: '我的待办', tab: '我的待办',
...@@ -72,13 +116,28 @@ function getcolumns(setdrawer) { ...@@ -72,13 +116,28 @@ function getcolumns(setdrawer) {
title: '下次追踪日期', title: '下次追踪日期',
dataIndex: 'nextTrackDate', dataIndex: 'nextTrackDate',
key: 'nextTrackDateList', key: 'nextTrackDateList',
valueType: 'dateTimeRange', valueType: 'dateRange',
fieldProps: { render: (text, row, _, action) => {
showTime: { return (
format: 'HH:mm', <span
}, style={{
format: 'YYYY-MM-DD HH:mm', color: `${
row.nextTrackDate.valueOf() < dayjs().format('YYYY-MM-DD').valueOf()
? '#f50'
: 'rgba(0, 0, 0, 0.85)'
}`,
}}
>
{row.nextTrackDate}
</span>
);
}, },
// fieldProps: {
// showTime: {
// format: 'HH:mm',
// },
// format: 'YYYY-MM-DD HH:mm',
// },
}, },
{ {
title: '最新追踪人员', title: '最新追踪人员',
...@@ -101,17 +160,11 @@ function getcolumns(setdrawer) { ...@@ -101,17 +160,11 @@ function getcolumns(setdrawer) {
title: '工单状态', title: '工单状态',
dataIndex: 'statusName', dataIndex: 'statusName',
key: 'status', key: 'status',
valueType: 'radio', valueType: 'select',
options: [ options: listOptions,
{ fieldProps: {
label: '待维修', dropdownMatchSelectWidth: 150,
value: '1', },
},
{
label: '维修中',
value: '2',
},
],
}, },
], ],
pathconfig: { pathconfig: {
...@@ -215,17 +268,11 @@ function getcolumns(setdrawer) { ...@@ -215,17 +268,11 @@ function getcolumns(setdrawer) {
title: '工单状态', title: '工单状态',
dataIndex: 'statusName', dataIndex: 'statusName',
key: 'status', key: 'status',
valueType: 'radio', valueType: 'select',
options: [ options: listOptions,
{ fieldProps: {
label: '待维修', dropdownMatchSelectWidth: 150,
value: '1', },
},
{
label: '维修中',
value: '2',
},
],
}, },
], ],
pathconfig: { pathconfig: {
...@@ -329,17 +376,11 @@ function getcolumns(setdrawer) { ...@@ -329,17 +376,11 @@ function getcolumns(setdrawer) {
title: '工单状态', title: '工单状态',
dataIndex: 'statusName', dataIndex: 'statusName',
key: 'status', key: 'status',
valueType: 'radio', valueType: 'select',
options: [ options: listOptions,
{ fieldProps: {
label: '待维修', dropdownMatchSelectWidth: 150,
value: '1', },
},
{
label: '维修中',
value: '2',
},
],
}, },
], ],
pathconfig: { pathconfig: {
......
/* eslint-disable react-hooks/exhaustive-deps */
/* 追踪工单 /* 追踪工单
* @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-18 17:45:01 * @Last Modified time: 2023-01-29 16:29:20
*/ */
import * as React from 'react'; import * as React from 'react';
import { useState, useMemo, useRef } from 'react'; import { useState, useMemo, useRef, useEffect } from 'react';
import DrawerPro from '@/components/DrawerPro'; import DrawerPro from '@/components/DrawerPro';
import AutoTable from '@/components/AutoTable'; import AutoTable from '@/components/AutoTable';
import PremButton from '@/components/PremButton'; import PremButton from '@/components/PremButton';
...@@ -23,6 +24,7 @@ function Failure(props) { ...@@ -23,6 +24,7 @@ function Failure(props) {
formRef = useRef(); formRef = useRef();
const [drawer, setdrawer] = useState({ const [drawer, setdrawer] = useState({
open: false, open: false,
SpecName: null,
}), }),
[activeTabKey, setactiveTabKey] = useState('1'); [activeTabKey, setactiveTabKey] = useState('1');
...@@ -39,6 +41,19 @@ function Failure(props) { ...@@ -39,6 +41,19 @@ function Failure(props) {
}, },
}); });
useEffect(async () => {
let res = await doFetch({
url: '/base/pmBaseBusinessData/queryBySpecName',
params: {
businessSpecName: 'TRACKING_ORDER_DISTRIBUTE',
},
});
setdrawer((s) => ({
...s,
SpecName: res?.data?.data,
}));
}, []);
// 重新指派 // 重新指派
const Reassig = () => { const Reassig = () => {
return ( return (
...@@ -481,9 +496,14 @@ function Failure(props) { ...@@ -481,9 +496,14 @@ function Failure(props) {
}; };
const columns = useMemo(() => { const columns = useMemo(() => {
let defcolumn = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.columns; let defcolumn = getcolumns(setdrawer, drawer?.SpecName?.businessData).filter(
(it) => it.key == activeTabKey,
)[0]?.columns;
//console.log(defcolumn); //console.log(defcolumn);
let defpath = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {}; let defpath =
getcolumns(setdrawer, drawer?.SpecName?.businessData).filter(
(it) => it.key == activeTabKey,
)[0]?.pathconfig ?? {};
if (activeTabKey == '1') { if (activeTabKey == '1') {
return defcolumn.concat({ return defcolumn.concat({
......
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