Commit d14b2459 authored by TZW's avatar TZW

111

parent 72fc86d5
import { doFetch } from '@/utils/doFetch'; import { doFetch } from '@/utils/doFetch';
import dayjs from "dayjs"; import dayjs from 'dayjs';
function getcolumns(setdrawer) { function getcolumns(setdrawer) {
return { return {
columns: [ columns: [
...@@ -12,19 +12,21 @@ function getcolumns(setdrawer) { ...@@ -12,19 +12,21 @@ function getcolumns(setdrawer) {
return ( return (
<a <a
onClick={async () => { onClick={async () => {
let res = await doFetch({ url: "/check/umEquipmentCheckTask/queryDetails", params: { id: row.id } }); let res = await doFetch({
if (res.code == "0000") { url: '/check/umEquipmentCheckTask/queryDetails',
params: { id: row.id },
});
if (res.code == '0000') {
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
open: true, open: true,
val: 'detail', val: 'detail',
title: '详细信息', title: '详细信息',
item: { item: {
...res?.data?.basics ...res?.data?.basics,
} },
})); }));
} }
}} }}
> >
{row?.taskNo} {row?.taskNo}
...@@ -59,8 +61,8 @@ function getcolumns(setdrawer) { ...@@ -59,8 +61,8 @@ function getcolumns(setdrawer) {
}, },
], ],
fieldProps: { fieldProps: {
dropdownMatchSelectWidth: 100 dropdownMatchSelectWidth: 100,
} },
}, },
{ {
title: '点检截止日期', title: '点检截止日期',
...@@ -68,8 +70,21 @@ function getcolumns(setdrawer) { ...@@ -68,8 +70,21 @@ function getcolumns(setdrawer) {
key: 'checkCloseDateList', key: 'checkCloseDateList',
valueType: 'dateRange', valueType: 'dateRange',
render: (text, row, _, action) => { render: (text, row, _, action) => {
return <span style={{ color: `${dayjs(row.checkCloseDate).valueOf() < dayjs().format("YYYY-MM-DD").valueOf() ? "#f50" : "rgba(0, 0, 0, 0.85)"}` }}>{row.checkCloseDate}</span> return (
} <span
style={{
color: `${
dayjs(row.checkCloseDate).valueOf() <
dayjs(dayjs().format('YYYY-MM-DD')).valueOf()
? '#f50'
: 'rgba(0, 0, 0, 0.85)'
}`,
}}
>
{row.checkCloseDate}
</span>
);
},
}, },
], ],
pathconfig: { pathconfig: {
......
import dayjs from "dayjs"; import dayjs from 'dayjs';
import { doFetch } from '@/utils/doFetch'; import { doFetch } from '@/utils/doFetch';
function getcolumns(setdrawer) { function getcolumns(setdrawer) {
return [ return [
...@@ -15,8 +15,11 @@ function getcolumns(setdrawer) { ...@@ -15,8 +15,11 @@ function getcolumns(setdrawer) {
return ( return (
<a <a
onClick={async () => { onClick={async () => {
let res = await doFetch({ url: "/check/umEquipmentCheckTask/queryDetails", params: { id: row.id } }); let res = await doFetch({
if (res.code == "0000") { url: '/check/umEquipmentCheckTask/queryDetails',
params: { id: row.id },
});
if (res.code == '0000') {
const { taskNo, createTime, statusName, planNo, status } = res?.data?.basics; const { taskNo, createTime, statusName, planNo, status } = res?.data?.basics;
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
...@@ -29,10 +32,10 @@ function getcolumns(setdrawer) { ...@@ -29,10 +32,10 @@ function getcolumns(setdrawer) {
createTime, createTime,
statusName, statusName,
planNo, planNo,
status status,
},
...res?.data,
}, },
...res?.data
}
})); }));
} }
}} }}
...@@ -40,7 +43,7 @@ function getcolumns(setdrawer) { ...@@ -40,7 +43,7 @@ function getcolumns(setdrawer) {
{row?.taskNo} {row?.taskNo}
</a> </a>
); );
} },
}, },
{ {
title: '设备编号', title: '设备编号',
...@@ -71,8 +74,8 @@ function getcolumns(setdrawer) { ...@@ -71,8 +74,8 @@ function getcolumns(setdrawer) {
}, },
], ],
fieldProps: { fieldProps: {
dropdownMatchSelectWidth: 100 dropdownMatchSelectWidth: 100,
} },
}, },
{ {
title: '点检截止日期', title: '点检截止日期',
...@@ -81,8 +84,21 @@ function getcolumns(setdrawer) { ...@@ -81,8 +84,21 @@ function getcolumns(setdrawer) {
hideInForm: true, hideInForm: true,
valueType: 'dateRange', valueType: 'dateRange',
render: (text, row, _, action) => { render: (text, row, _, action) => {
return <span style={{ color: `${dayjs(row.checkCloseDate).valueOf() < dayjs().format("YYYY-MM-DD").valueOf() ? "#f50" : "rgba(0, 0, 0, 0.85)"}` }}>{row.checkCloseDate}</span> return (
} <span
style={{
color: `${
dayjs(row.checkCloseDate).valueOf() <
dayjs(dayjs().format('YYYY-MM-DD')).valueOf()
? '#f50'
: 'rgba(0, 0, 0, 0.85)'
}`,
}}
>
{row.checkCloseDate}
</span>
);
},
}, },
{ {
title: '接单时间', title: '接单时间',
...@@ -116,8 +132,8 @@ function getcolumns(setdrawer) { ...@@ -116,8 +132,8 @@ function getcolumns(setdrawer) {
}, },
], ],
fieldProps: { fieldProps: {
dropdownMatchSelectWidth: 100 dropdownMatchSelectWidth: 100,
} },
}, },
], ],
pathconfig: { pathconfig: {
...@@ -145,8 +161,11 @@ function getcolumns(setdrawer) { ...@@ -145,8 +161,11 @@ function getcolumns(setdrawer) {
return ( return (
<a <a
onClick={async () => { onClick={async () => {
let res = await doFetch({ url: "/check/umEquipmentCheckTask/queryDetails", params: { id: row.id } }); let res = await doFetch({
if (res.code == "0000") { url: '/check/umEquipmentCheckTask/queryDetails',
params: { id: row.id },
});
if (res.code == '0000') {
const { taskNo, createTime, statusName, planNo, status } = res?.data?.basics; const { taskNo, createTime, statusName, planNo, status } = res?.data?.basics;
setdrawer((s) => ({ setdrawer((s) => ({
...s, ...s,
...@@ -159,10 +178,10 @@ function getcolumns(setdrawer) { ...@@ -159,10 +178,10 @@ function getcolumns(setdrawer) {
createTime, createTime,
statusName, statusName,
planNo, planNo,
status status,
},
...res?.data,
}, },
...res?.data
}
})); }));
} }
}} }}
...@@ -170,7 +189,7 @@ function getcolumns(setdrawer) { ...@@ -170,7 +189,7 @@ function getcolumns(setdrawer) {
{row?.taskNo} {row?.taskNo}
</a> </a>
); );
} },
}, },
{ {
title: '设备编号', title: '设备编号',
...@@ -201,8 +220,8 @@ function getcolumns(setdrawer) { ...@@ -201,8 +220,8 @@ function getcolumns(setdrawer) {
}, },
], ],
fieldProps: { fieldProps: {
dropdownMatchSelectWidth: 100 dropdownMatchSelectWidth: 100,
} },
}, },
{ {
title: '点检截止日期', title: '点检截止日期',
...@@ -211,8 +230,21 @@ function getcolumns(setdrawer) { ...@@ -211,8 +230,21 @@ function getcolumns(setdrawer) {
hideInForm: true, hideInForm: true,
valueType: 'dateRange', valueType: 'dateRange',
render: (text, row, _, action) => { render: (text, row, _, action) => {
return <span style={{ color: `${dayjs(row.checkCloseDate).valueOf() < dayjs().format("YYYY-MM-DD").valueOf() ? "#f50" : "rgba(0, 0, 0, 0.85)"}` }}>{row.checkCloseDate}</span> return (
} <span
style={{
color: `${
dayjs(row.checkCloseDate).valueOf() <
dayjs(dayjs().format('YYYY-MM-DD')).valueOf()
? '#f50'
: 'rgba(0, 0, 0, 0.85)'
}`,
}}
>
{row.checkCloseDate}
</span>
);
},
}, },
{ {
title: '接单时间', title: '接单时间',
...@@ -254,8 +286,8 @@ function getcolumns(setdrawer) { ...@@ -254,8 +286,8 @@ function getcolumns(setdrawer) {
}, },
], ],
fieldProps: { fieldProps: {
dropdownMatchSelectWidth: 100 dropdownMatchSelectWidth: 100,
} },
}, },
], ],
pathconfig: { pathconfig: {
...@@ -283,16 +315,21 @@ function getcolumns(setdrawer) { ...@@ -283,16 +315,21 @@ function getcolumns(setdrawer) {
return ( return (
<a <a
onClick={async () => { onClick={async () => {
let res = await doFetch({ url: "/check/umEquipmentCheckTaskHis/queryDetails", params: { id: row.id } }); let res = await doFetch({
if (res.code == "0000") { url: '/check/umEquipmentCheckTaskHis/queryDetails',
const { taskNo, createTime, statusName, planNo, endTime, status } = res?.data?.basics; params: { id: row.id },
});
if (res.code == '0000') {
const { taskNo, createTime, statusName, planNo, endTime, status } =
res?.data?.basics;
let newArr = []; let newArr = [];
if (row.status == 4) { if (row.status == 4) {
newArr = res?.data?.delay?.item?.map(it => { newArr = res?.data?.delay?.item?.map((it) => {
return { return {
...it, ...it,
result: it.judgeType == 1 ? it.judgeResultQualitative : it.judgeResultRation result:
} it.judgeType == 1 ? it.judgeResultQualitative : it.judgeResultRation,
};
}); });
} }
setdrawer((s) => ({ setdrawer((s) => ({
...@@ -307,23 +344,22 @@ function getcolumns(setdrawer) { ...@@ -307,23 +344,22 @@ function getcolumns(setdrawer) {
statusName, statusName,
planNo, planNo,
endTime, endTime,
status: row.status status: row.status,
}, },
...res?.data, ...res?.data,
delay: res?.data?.delay && { delay: res?.data?.delay && {
...res?.data?.delay, ...res?.data?.delay,
itemlist: newArr itemlist: newArr,
} },
} },
})); }));
} }
}} }}
> >
{row?.taskNo} {row?.taskNo}
</a> </a>
); );
} },
}, },
{ {
title: '设备编号', title: '设备编号',
...@@ -354,8 +390,8 @@ function getcolumns(setdrawer) { ...@@ -354,8 +390,8 @@ function getcolumns(setdrawer) {
}, },
], ],
fieldProps: { fieldProps: {
dropdownMatchSelectWidth: 100 dropdownMatchSelectWidth: 100,
} },
}, },
{ {
title: '点检截止日期', title: '点检截止日期',
...@@ -364,8 +400,8 @@ function getcolumns(setdrawer) { ...@@ -364,8 +400,8 @@ function getcolumns(setdrawer) {
hideInForm: true, hideInForm: true,
valueType: 'dateRange', valueType: 'dateRange',
render: (text, row, _, action) => { render: (text, row, _, action) => {
return <span>{row.checkCloseDate}</span> return <span>{row.checkCloseDate}</span>;
} },
}, },
{ {
title: '接单时间', title: '接单时间',
...@@ -381,8 +417,8 @@ function getcolumns(setdrawer) { ...@@ -381,8 +417,8 @@ function getcolumns(setdrawer) {
hideInForm: true, hideInForm: true,
valueType: 'dateRange', valueType: 'dateRange',
render: (text, row, _, action) => { render: (text, row, _, action) => {
return <span>{row.endTime}</span> return <span>{row.endTime}</span>;
} },
}, },
{ {
title: '点检人员', title: '点检人员',
...@@ -420,8 +456,8 @@ function getcolumns(setdrawer) { ...@@ -420,8 +456,8 @@ function getcolumns(setdrawer) {
}, },
], ],
fieldProps: { fieldProps: {
dropdownMatchSelectWidth: 100 dropdownMatchSelectWidth: 100,
} },
}, },
], ],
pathconfig: { pathconfig: {
......
...@@ -92,7 +92,8 @@ function getcolumns(setdrawer) { ...@@ -92,7 +92,8 @@ function getcolumns(setdrawer) {
<span <span
style={{ style={{
color: `${ color: `${
dayjs(row.planMaintainDate).valueOf() < dayjs().format('YYYY-MM-DD').valueOf() dayjs(row.planMaintainDate).valueOf() <
dayjs(dayjs().format('YYYY-MM-DD')).valueOf()
? '#f50' ? '#f50'
: 'rgba(0, 0, 0, 0.85)' : 'rgba(0, 0, 0, 0.85)'
}`, }`,
......
...@@ -412,7 +412,8 @@ function getcolumns(setdrawer) { ...@@ -412,7 +412,8 @@ function getcolumns(setdrawer) {
<span <span
style={{ style={{
color: `${ color: `${
dayjs(row.planMaintainDate).valueOf() < dayjs().format('YYYY-MM-DD').valueOf() dayjs(row.planMaintainDate).valueOf() <
dayjs(dayjs().format('YYYY-MM-DD')).valueOf()
? '#f50' ? '#f50'
: 'rgba(0, 0, 0, 0.85)' : 'rgba(0, 0, 0, 0.85)'
}`, }`,
......
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