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: [
{
title: '点检单号',
dataIndex: 'taskNo',
key: 'taskNo',
hideInForm: false,
render: (text, row, _, action) => {
return (
<a
onClick={async () => {
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
}
}));
}
}}
>
{row?.taskNo}
</a>
);
},
},
{
title: '设备编号',
dataIndex: 'equipmentNo',
key: 'equipmentNo',
},
{
title: '设备名称',
dataIndex: 'equipmentName',
key: 'equipmentName',
},
{
title: '点检类型',
dataIndex: 'checkTypeName',
key: 'checkType',
valueType: 'select',
hideInForm: true,
options: [
{
label: '制造点检',
value: '1',
return {
columns: [
{
title: '点检单号',
dataIndex: 'taskNo',
key: 'taskNo',
hideInForm: false,
render: (text, row, _, action) => {
return (
<a
onClick={async () => {
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,
},
{
label: '设备点检',
value: '2',
},
],
fieldProps: {
dropdownMatchSelectWidth: 100
}
},
{
title: '点检截止日期',
dataIndex: 'checkCloseDate',
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>
}));
}
},
}}
>
{row?.taskNo}
</a>
);
},
},
{
title: '设备编号',
dataIndex: 'equipmentNo',
key: 'equipmentNo',
},
{
title: '设备名称',
dataIndex: 'equipmentName',
key: 'equipmentName',
},
{
title: '点检类型',
dataIndex: 'checkTypeName',
key: 'checkType',
valueType: 'select',
hideInForm: true,
options: [
{
label: '制造点检',
value: '1',
},
{
label: '设备点检',
value: '2',
},
],
pathconfig: {
enableadd: false,
enableedit: false,
enabledelete: false,
enabledetail: true,
add: '',
edit: '',
list: '/check/umEquipmentCheckTask/queryCheckOrders',
delete: '',
detail: '',
fieldProps: {
dropdownMatchSelectWidth: 100,
},
},
{
title: '点检截止日期',
dataIndex: 'checkCloseDate',
key: 'checkCloseDateList',
valueType: 'dateRange',
render: (text, row, _, action) => {
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: {
enableadd: false,
enableedit: false,
enabledelete: false,
enabledetail: true,
add: '',
edit: '',
list: '/check/umEquipmentCheckTask/queryCheckOrders',
delete: '',
detail: '',
},
};
}
export default getcolumns;
This diff is collapsed.
......@@ -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