Commit d14b2459 authored by TZW's avatar TZW

111

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