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: [
{ {
title: '点检单号', title: '点检单号',
dataIndex: 'taskNo', dataIndex: 'taskNo',
key: 'taskNo', key: 'taskNo',
hideInForm: false, hideInForm: false,
render: (text, row, _, action) => { render: (text, row, _, action) => {
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',
setdrawer((s) => ({ params: { id: row.id },
...s, });
open: true, if (res.code == '0000') {
val: 'detail', setdrawer((s) => ({
title: '详细信息', ...s,
item: { open: true,
...res?.data?.basics 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',
}, },
{ }));
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: { fieldProps: {
enableadd: false, dropdownMatchSelectWidth: 100,
enableedit: false, },
enabledelete: false, },
enabledetail: true, {
add: '', title: '点检截止日期',
edit: '', dataIndex: 'checkCloseDate',
list: '/check/umEquipmentCheckTask/queryCheckOrders', key: 'checkCloseDateList',
delete: '', valueType: 'dateRange',
detail: '', 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; export default getcolumns;
This diff is collapsed.
...@@ -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